diff --git a/lib/jekyll/entry_filter.rb b/lib/jekyll/entry_filter.rb index 0b00218b..d2cd6f81 100644 --- a/lib/jekyll/entry_filter.rb +++ b/lib/jekyll/entry_filter.rb @@ -65,9 +65,7 @@ module Jekyll entry = ensure_leading_slash(e) enum.any? do |exp| item = ensure_leading_slash(exp) - Jekyll.logger.debug "glob_include?(#{entry})" - Jekyll.logger.debug " ==> File.fnmatch?(#{item}, #{entry}) == #{File.fnmatch?(item, entry)}" - File.fnmatch?(item, entry) + File.fnmatch?(item, entry) || entry.start_with?(item) end end end diff --git a/test/test_entry_filter.rb b/test/test_entry_filter.rb index aea09601..e562277e 100644 --- a/test/test_entry_filter.rb +++ b/test/test_entry_filter.rb @@ -25,6 +25,22 @@ class TestEntryFilter < Test::Unit::TestCase assert_equal files, @site.filter_entries(excludes + files + ["excludeA"]) end + should "filter entries with exclude relative to site source" do + excludes = %w[README TODO css] + files = %w[index.html vendor/css .htaccess] + + @site.exclude = excludes + assert_equal files, @site.filter_entries(excludes + files + ["css"]) + end + + should "filter excluded directory and contained files" do + excludes = %w[README TODO css] + files = %w[index.html .htaccess] + + @site.exclude = excludes + assert_equal files, @site.filter_entries(excludes + files + ["css", "css/main.css", "css/vendor.css"]) + end + should "not filter entries within include" do includes = %w[_index.html .htaccess include*] files = %w[index.html _index.html .htaccess includeA]