Extracted `aggregate_post_info` 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:16:31 +01:00
parent 67a2369854
commit 29169aa858
2 changed files with 11 additions and 11 deletions

View File

@ -122,5 +122,14 @@ module Jekyll
name.gsub!(/(^|\b\s)\s+($|\s?\b)/, '\\1\\2')
name.gsub(/\s+/, '_')
end
# Aggregate post information
#
# post - The Post object to aggregate information for
#
# Returns nothing
def aggregate_post_info(post)
site.posts << post
end
end
end

View File

@ -178,7 +178,7 @@ module Jekyll
posts = reader.read_content(dir, '_posts', Post)
posts.each do |post|
aggregate_post_info(post) if publisher.publish?(post)
reader.aggregate_post_info(post) if publisher.publish?(post)
end
end
@ -193,7 +193,7 @@ module Jekyll
drafts.each do |draft|
if draft.published?
aggregate_post_info(draft)
reader.aggregate_post_info(draft)
end
end
end
@ -355,15 +355,6 @@ module Jekyll
end
end
# Aggregate post information
#
# post - The Post object to aggregate information for
#
# Returns nothing
def aggregate_post_info(post)
posts << post
end
def relative_permalinks_deprecation_method
if config['relative_permalinks'] && has_relative_page?
Jekyll::Deprecator.deprecation_message "Since v2.0, permalinks for pages" +