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 39d0bad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 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
4 changes: 2 additions & 2 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 if outside_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,7 +142,7 @@ 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 outside_configured_directory?(dir)
collections_dir = site.config["collections_dir"]
!collections_dir.empty? && !dir.start_with?("/#{collections_dir}")
end
Expand Down

0 comments on commit 39d0bad

Please sign in to comment.