Rubocop: lib/jekyll/readers/post_reader.rb
This commit is contained in:
		
							parent
							
								
									615a9ee9ac
								
							
						
					
					
						commit
						0696e6c169
					
				|  | @ -12,7 +12,7 @@ module Jekyll | ||||||
|     # |     # | ||||||
|     # Returns nothing. |     # Returns nothing. | ||||||
|     def read_drafts(dir) |     def read_drafts(dir) | ||||||
|       read_publishable(dir, '_drafts', Document::DATELESS_FILENAME_MATCHER) |       read_publishable(dir, "_drafts", Document::DATELESS_FILENAME_MATCHER) | ||||||
|     end |     end | ||||||
| 
 | 
 | ||||||
|     # Read all the files in <source>/<dir>/_posts and create a new Document |     # Read all the files in <source>/<dir>/_posts and create a new Document | ||||||
|  | @ -22,7 +22,7 @@ module Jekyll | ||||||
|     # |     # | ||||||
|     # Returns nothing. |     # Returns nothing. | ||||||
|     def read_posts(dir) |     def read_posts(dir) | ||||||
|       read_publishable(dir, '_posts', Document::DATE_FILENAME_MATCHER) |       read_publishable(dir, "_posts", Document::DATE_FILENAME_MATCHER) | ||||||
|     end |     end | ||||||
| 
 | 
 | ||||||
|     # Read all the files in <source>/<dir>/<magic_dir> and create a new |     # Read all the files in <source>/<dir>/<magic_dir> and create a new | ||||||
|  | @ -32,9 +32,10 @@ module Jekyll | ||||||
|     # |     # | ||||||
|     # Returns nothing. |     # Returns nothing. | ||||||
|     def read_publishable(dir, magic_dir, matcher) |     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) |         docs.each(&:read) | ||||||
|       end.select do |doc| |       end | ||||||
|  |       documents.select do |doc| | ||||||
|         site.publisher.publish?(doc).tap do |will_publish| |         site.publisher.publish?(doc).tap do |will_publish| | ||||||
|           if !will_publish && site.publisher.hidden_in_the_future?(doc) |           if !will_publish && site.publisher.hidden_in_the_future?(doc) | ||||||
|             Jekyll.logger.debug "Skipping:", "#{doc.relative_path} has a future date" |             Jekyll.logger.debug "Skipping:", "#{doc.relative_path} has a future date" | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue