Skip to content

Commit

Permalink
Merge pull request #5860 from ashmaroli/exclude-patch
Browse files Browse the repository at this point in the history
Merge pull request 5860
  • Loading branch information
jekyllbot committed Feb 11, 2017
2 parents 7b58bcf + 3745b24 commit afe6e36
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
2 changes: 2 additions & 0 deletions features/site_configuration.feature
Expand Up @@ -44,9 +44,11 @@ Feature: Site configuration
Given I have an "Rakefile" file that contains "I want to be excluded"
And I have an "README" file that contains "I want to be excluded"
And I have an "index.html" file that contains "I want to be included"
And I have a "Gemfile" file that contains "gem 'include-me'"
And I have a configuration file with "exclude" set to "['Rakefile', 'README']"
When I run jekyll build
Then I should see "I want to be included" in "_site/index.html"
And the "_site/Gemfile" file should exist
And the "_site/Rakefile" file should not exist
And the "_site/README" file should not exist

Expand Down
3 changes: 2 additions & 1 deletion lib/jekyll/configuration.rb
Expand Up @@ -18,7 +18,8 @@ class Configuration < Hash
"safe" => false,
"include" => [".htaccess"],
"exclude" => %w(
node_modules vendor/bundle/ vendor/cache/ vendor/gems/ vendor/ruby/
Gemfile Gemfile.lock node_modules vendor/bundle/ vendor/cache/ vendor/gems/
vendor/ruby/
),
"keep_files" => [".git", ".svn"],
"encoding" => "utf-8",
Expand Down
15 changes: 12 additions & 3 deletions lib/site_template/_config.yml
Expand Up @@ -29,6 +29,15 @@ markdown: kramdown
theme: minima
gems:
- jekyll-feed
exclude:
- Gemfile
- Gemfile.lock

# Exclude from processing.
# The following items will not be processed, by default. Create a custom list
# to override the default setting.
# exclude:
# - Gemfile
# - Gemfile.lock
# - node_modules
# - vendor/bundle/
# - vendor/cache/
# - vendor/gems/
# - vendor/ruby/
2 changes: 2 additions & 0 deletions test/test_configuration.rb
Expand Up @@ -55,6 +55,8 @@ class TestConfiguration < JekyllUnitTest

should "exclude ruby vendor directories" do
exclude = Configuration.from({})["exclude"]
assert_includes exclude, "Gemfile"
assert_includes exclude, "Gemfile.lock"
assert_includes exclude, "vendor/bundle/"
assert_includes exclude, "vendor/cache/"
assert_includes exclude, "vendor/gems/"
Expand Down

0 comments on commit afe6e36

Please sign in to comment.