Extracted `read_data` 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:07:53 +01:00
parent 5b0e2a294d
commit 537235c38b
2 changed files with 9 additions and 9 deletions

View File

@ -74,6 +74,14 @@ module Jekyll
end end
end end
# Read and parse all yaml files under <source>/<dir>
#
# Returns nothing
def read_data(dir)
base = in_source_dir(dir)
read_data_to(base, site.data)
end
# Read and parse all yaml files under <dir> and add them to the # Read and parse all yaml files under <dir> and add them to the
# <data> variable. # <data> variable.
# #

View File

@ -131,7 +131,7 @@ module Jekyll
def read def read
self.layouts = LayoutReader.new(self).read self.layouts = LayoutReader.new(self).read
read_directories read_directories
read_data(config['data_source']) reader.read_data(config['data_source'])
read_collections read_collections
end end
@ -206,14 +206,6 @@ module Jekyll
end end
end end
# Read and parse all yaml files under <source>/<dir>
#
# Returns nothing
def read_data(dir)
base = reader.in_source_dir(dir)
reader.read_data_to(base, self.data)
end
# Read in all collections specified in the configuration # Read in all collections specified in the configuration
# #
# Returns nothing. # Returns nothing.