Rubocop: lib/jekyll/readers/post_reader.rb

This commit is contained in:
Pat Hawks 2016-05-26 00:10:31 -05:00
parent 615a9ee9ac
commit 0696e6c169
1 changed files with 6 additions and 5 deletions

View File

@ -12,7 +12,7 @@ module Jekyll
#
# Returns nothing.
def read_drafts(dir)
read_publishable(dir, '_drafts', Document::DATELESS_FILENAME_MATCHER)
read_publishable(dir, "_drafts", Document::DATELESS_FILENAME_MATCHER)
end
# Read all the files in <source>/<dir>/_posts and create a new Document
@ -22,7 +22,7 @@ module Jekyll
#
# Returns nothing.
def read_posts(dir)
read_publishable(dir, '_posts', Document::DATE_FILENAME_MATCHER)
read_publishable(dir, "_posts", Document::DATE_FILENAME_MATCHER)
end
# Read all the files in <source>/<dir>/<magic_dir> and create a new
@ -32,9 +32,10 @@ module Jekyll
#
# Returns nothing.
def read_publishable(dir, magic_dir, matcher)
read_content(dir, magic_dir, matcher).tap do |docs|
documents = read_content(dir, magic_dir, matcher).tap do |docs|
docs.each(&:read)
end.select do |doc|
end
documents.select do |doc|
site.publisher.publish?(doc).tap do |will_publish|
if !will_publish && site.publisher.hidden_in_the_future?(doc)
Jekyll.logger.debug "Skipping:", "#{doc.relative_path} has a future date"