Skip to content

Instantly share code, notes, and snippets.

@shigeya
Created August 28, 2013 04:17
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 shigeya/6362099 to your computer and use it in GitHub Desktop.
Save shigeya/6362099 to your computer and use it in GitHub Desktop.
# Ruby 1.8's File.read don't support option.
# read_with_options ignore optional parameter for 1.8,
# and act as alias for 1.9 or later.
class File
if RUBY_VERSION < '1.9'
def self.read_with_options(path, opts = {})
self.read(path)
end
else
def self.read_with_options(path, opts = {})
self.read(path, opts)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment