From 2f88a0c0a172504a6a03809239a6343153134737 Mon Sep 17 00:00:00 2001 From: Martin Jorn Rogalla Date: Wed, 4 Mar 2015 20:55:53 +0100 Subject: [PATCH] Extracted `read_collections` from site.rb into reader.rb - Extracted - Updated References - Ran Tests Signed-off-by: Martin Jorn Rogalla --- lib/jekyll/reader.rb | 9 +++++++++ lib/jekyll/site.rb | 11 +---------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/jekyll/reader.rb b/lib/jekyll/reader.rb index 689d1f30..b0857521 100644 --- a/lib/jekyll/reader.rb +++ b/lib/jekyll/reader.rb @@ -180,6 +180,15 @@ module Jekyll end end + # Read in all collections specified in the configuration + # + # Returns nothing. + def read_collections + site.collections.each do |_, collection| + collection.read unless collection.label.eql?("data") + end + end + def sanitize_filename(name) name.gsub!(/[^\w\s_-]+/, '') name.gsub!(/(^|\b\s)\s+($|\s?\b)/, '\\1\\2') diff --git a/lib/jekyll/site.rb b/lib/jekyll/site.rb index 59ffd5aa..b6904ef9 100644 --- a/lib/jekyll/site.rb +++ b/lib/jekyll/site.rb @@ -132,16 +132,7 @@ module Jekyll self.layouts = LayoutReader.new(self).read reader.read_directories reader.read_data(config['data_source']) - read_collections - end - - # Read in all collections specified in the configuration - # - # Returns nothing. - def read_collections - collections.each do |_, collection| - collection.read unless collection.label.eql?("data") - end + reader.read_collections end # Run each of the Generators.