parent
82f1b32896
commit
70870328bf
|
@ -98,7 +98,8 @@ module Jekyll
|
|||
pattern_with_source = PathManager.join(site.source, pattern)
|
||||
|
||||
File.fnmatch?(pattern_with_source, entry_with_source) ||
|
||||
entry_with_source.start_with?(pattern_with_source)
|
||||
entry_with_source.start_with?(pattern_with_source) ||
|
||||
(pattern_with_source == "#{entry_with_source}/" if File.directory?(entry_with_source))
|
||||
when Regexp
|
||||
pattern.match?(entry_with_source)
|
||||
else
|
||||
|
|
|
@ -149,5 +149,12 @@ class TestEntryFilter < JekyllUnitTest
|
|||
assert @filter.glob_include?(data, "vendor/bundle/jekyll/lib/page.rb")
|
||||
assert @filter.glob_include?(data, "/vendor/ruby/lib/set.rb")
|
||||
end
|
||||
|
||||
should "match directory only if there is trailing slash" do
|
||||
data = ["_glob_include_test/_is_dir/", "_glob_include_test/_not_dir/"]
|
||||
assert @filter.glob_include?(data, "_glob_include_test/_is_dir")
|
||||
assert @filter.glob_include?(data, "_glob_include_test/_is_dir/include_me.txt")
|
||||
refute @filter.glob_include?(data, "_glob_include_test/_not_dir")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue