Extracted `read_collections` from site.rb into reader.rb

- Extracted
  - Updated References
  - Ran Tests

Signed-off-by: Martin Jorn Rogalla <martin@martinrogalla.com>
This commit is contained in:
Martin Jorn Rogalla 2015-03-04 20:55:53 +01:00
parent 2857350df1
commit 2f88a0c0a1
2 changed files with 10 additions and 10 deletions

View File

@ -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')

View File

@ -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.