Skip to content

Instantly share code, notes, and snippets.

@dsisnero
Created July 5, 2012 18:41
Show Gist options
  • Select an option

  • Save dsisnero/3055583 to your computer and use it in GitHub Desktop.

Select an option

Save dsisnero/3055583 to your computer and use it in GitHub Desktop.
File.open with to_path
def my_open(filename)
filename = filename.to_path if filename.respond_to?(:to_path)
filename = filename.to_str
# ...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment