Skip to content

Instantly share code, notes, and snippets.

@dsisnero
Created July 5, 2012 18:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dsisnero/3055583 to your computer and use it in GitHub Desktop.
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