From 601f89d4d199c0200041a73375a419c64d09a39e Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sun, 8 Dec 2013 00:50:12 -0500 Subject: [PATCH] Remove File.read_with_options patch to allow 1.9 and 1.8 to behave the same --- lib/jekyll/convertible.rb | 4 ++-- lib/jekyll/core_ext.rb | 9 --------- lib/jekyll/tags/include.rb | 2 +- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/lib/jekyll/convertible.rb b/lib/jekyll/convertible.rb index 723b0da7..815c36b0 100644 --- a/lib/jekyll/convertible.rb +++ b/lib/jekyll/convertible.rb @@ -35,8 +35,8 @@ module Jekyll # Returns nothing. def read_yaml(base, name, opts = {}) begin - self.content = File.read_with_options(File.join(base, name), - merged_file_read_opts(opts)) + 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 self.data = YAML.safe_load($1) diff --git a/lib/jekyll/core_ext.rb b/lib/jekyll/core_ext.rb index c71c72f5..ce74d2ba 100644 --- a/lib/jekyll/core_ext.rb +++ b/lib/jekyll/core_ext.rb @@ -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 diff --git a/lib/jekyll/tags/include.rb b/lib/jekyll/tags/include.rb index a261e6f5..49033ab0 100644 --- a/lib/jekyll/tags/include.rb +++ b/lib/jekyll/tags/include.rb @@ -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