So, now this is duplicated. Is there a scenario where you're not using a block? If the location that generates the io always handles closing it, then it doesn't matter anyhow.

so, e.g.

```ruby
if path_or_io.respond_to?(:write)
  yield path_or_io
else
  write_to_file(path_or_io) {|io| yield io }
end

def write_to_file(path,&block)
  File.open(path_relative_to_base(path), 'w') do |file|
    yield file
  end
end
```