Skip to content

Commit

Permalink
make corrections based on feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
ashmaroli committed Jan 9, 2018
1 parent a09b646 commit a3f2a9f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions features/collections_dir.feature
Expand Up @@ -61,7 +61,7 @@ Feature: Collections Directory
Then I should get a zero exit status
And the _site directory should exist
And the "_site/puppies/rover.html" file should exist
And the "_site/post-at-root.html" file should not exist
And the "_site/2009/03/27/post-at-root.html" file should not exist
And the _site/_posts directory should not exist

Scenario: Rendered collection in custom collections_dir also containing drafts
Expand Down Expand Up @@ -150,8 +150,7 @@ Feature: Collections Directory
And the "_site/puppies/rover-in-gathering.html" file should exist
And the "_site/2009/03/27/post-in-gathering.html" file should exist
And the "_site/2009/03/27/draft-in-gathering.html" file should exist
And the "_site/gathering/2009/03/27/draft-in-gathering.html" file should not exist
And the "_site/2009/03/27/draft-at-root.html" file should not exist
But the "_site/puppies/rover-at-root.html" file should not exist
And the "_site/puppies/rover-at-root.html" file should not exist
And the _site/gathering directory should not exist
And the _site/_posts directory should not exist
6 changes: 3 additions & 3 deletions lib/jekyll/reader.rb
Expand Up @@ -62,7 +62,7 @@ def read_directories(dir = "")
#
# Returns nothing.
def retrieve_posts(dir)
return if not_within_configured_directory?(dir)
return unless within_configured_directory?(dir)
site.posts.docs.concat(PostReader.new(site).read_posts(dir))
site.posts.docs.concat(PostReader.new(site).read_drafts(dir)) if site.show_drafts
end
Expand Down Expand Up @@ -142,9 +142,9 @@ def get_entries(dir, subfolder)
#
# Returns true if a custom collections_dir has been set but current directory lies
# outside that directory.
def not_within_configured_directory?(dir)
def within_configured_directory?(dir)
collections_dir = site.config["collections_dir"]
!collections_dir.empty? && !dir.start_with?("/#{collections_dir}")
!collections_dir.empty? && dir.start_with?("/#{collections_dir}")
end
end
end

0 comments on commit a3f2a9f

Please sign in to comment.