Remove File.read_with_options patch to allow 1.9 and 1.8 to behave the same

This commit is contained in:
Parker Moore 2013-12-08 00:50:12 -05:00
parent f14c9db282
commit 601f89d4d1
3 changed files with 3 additions and 12 deletions

View File

@ -35,7 +35,7 @@ module Jekyll
# Returns nothing.
def read_yaml(base, name, opts = {})
begin
self.content = File.read_with_options(File.join(base, name),
self.content = File.read(File.join(base, name),
merged_file_read_opts(opts))
if self.content =~ /\A(---\s*\n.*?\n?)^(---\s*$\n?)/m
self.content = $POSTMATCH

View File

@ -61,12 +61,3 @@ module Enumerable
any? { |exp| File.fnmatch?(exp, e) }
end
end
# 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
def self.read_with_options(path, opts = {})
self.read(path, opts)
end
end

View File

@ -128,7 +128,7 @@ eos
# This method allows to modify the file content by inheriting from the class.
def source(file, context)
File.read_with_options(file, file_read_opts(context))
File.read(file, file_read_opts(context))
end
end
end