Add vendor/gems to the list of excluded & do some refactoring.
This commit is contained in:
parent
b194211a32
commit
7bf4627046
|
@ -17,7 +17,9 @@ module Jekyll
|
||||||
# Handling Reading
|
# Handling Reading
|
||||||
"safe" => false,
|
"safe" => false,
|
||||||
"include" => [".htaccess"],
|
"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"],
|
"keep_files" => [".git", ".svn"],
|
||||||
"encoding" => "utf-8",
|
"encoding" => "utf-8",
|
||||||
"markdown_ext" => "markdown,mkdown,mkdn,mkd,md",
|
"markdown_ext" => "markdown,mkdown,mkdn,mkd,md",
|
||||||
|
|
|
@ -36,8 +36,7 @@ module Jekyll
|
||||||
end
|
end
|
||||||
|
|
||||||
def included?(entry)
|
def included?(entry)
|
||||||
glob_include?(site.include,
|
glob_include?(site.include, entry)
|
||||||
entry)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def special?(entry)
|
def special?(entry)
|
||||||
|
@ -50,14 +49,14 @@ module Jekyll
|
||||||
end
|
end
|
||||||
|
|
||||||
def excluded?(entry)
|
def excluded?(entry)
|
||||||
excluded = glob_include?(site.exclude, relative_to_source(entry))
|
glob_include?(site.exclude, relative_to_source(entry)).tap do |excluded|
|
||||||
if excluded
|
if excluded
|
||||||
Jekyll.logger.debug(
|
Jekyll.logger.debug(
|
||||||
"EntryFilter:",
|
"EntryFilter:",
|
||||||
"excluded #{relative_to_source(entry)}"
|
"excluded #{relative_to_source(entry)}"
|
||||||
)
|
)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
excluded
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# --
|
# --
|
||||||
|
|
|
@ -52,6 +52,14 @@ class TestConfiguration < JekyllUnitTest
|
||||||
should "exclude node_modules" do
|
should "exclude node_modules" do
|
||||||
assert_includes Configuration.from({})["exclude"], "node_modules"
|
assert_includes Configuration.from({})["exclude"], "node_modules"
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
context "#add_default_collections" do
|
context "#add_default_collections" do
|
||||||
|
|
Loading…
Reference in New Issue