Add vendor/gems to the list of excluded & do some refactoring.

This commit is contained in:
Parker Moore 2016-11-09 09:22:00 -08:00
parent b194211a32
commit 7bf4627046
No known key found for this signature in database
GPG Key ID: 193CDEBA72063C58
3 changed files with 19 additions and 10 deletions

View File

@ -17,7 +17,9 @@ module Jekyll
# Handling Reading
"safe" => false,
"include" => [".htaccess"],
"exclude" => %w(node_modules vendor/bundle vendor/ruby vendor/cache),
"exclude" => %w(
node_modules vendor/bundle/ vendor/cache/ vendor/gems/ vendor/ruby/
),
"keep_files" => [".git", ".svn"],
"encoding" => "utf-8",
"markdown_ext" => "markdown,mkdown,mkdn,mkd,md",

View File

@ -36,8 +36,7 @@ module Jekyll
end
def included?(entry)
glob_include?(site.include,
entry)
glob_include?(site.include, entry)
end
def special?(entry)
@ -50,14 +49,14 @@ module Jekyll
end
def excluded?(entry)
excluded = glob_include?(site.exclude, relative_to_source(entry))
if excluded
Jekyll.logger.debug(
"EntryFilter:",
"excluded #{relative_to_source(entry)}"
)
glob_include?(site.exclude, relative_to_source(entry)).tap do |excluded|
if excluded
Jekyll.logger.debug(
"EntryFilter:",
"excluded #{relative_to_source(entry)}"
)
end
end
excluded
end
# --

View File

@ -52,6 +52,14 @@ class TestConfiguration < JekyllUnitTest
should "exclude node_modules" do
assert_includes Configuration.from({})["exclude"], "node_modules"
end
should "exclude ruby vendor directories" do
exclude = Configuration.from({})["exclude"]
assert_includes exclude, "vendor/bundle/"
assert_includes exclude, "vendor/cache/"
assert_includes exclude, "vendor/gems/"
assert_includes exclude, "vendor/ruby/"
end
end
context "#add_default_collections" do