Created
August 28, 2013 04:17
-
-
Save shigeya/6362099 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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