diff --git a/features/site_configuration.feature b/features/site_configuration.feature index 2d00f9b7..3aace794 100644 --- a/features/site_configuration.feature +++ b/features/site_configuration.feature @@ -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 diff --git a/lib/jekyll/configuration.rb b/lib/jekyll/configuration.rb index 27e245e4..b4bf7c5a 100644 --- a/lib/jekyll/configuration.rb +++ b/lib/jekyll/configuration.rb @@ -18,7 +18,8 @@ module Jekyll "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", diff --git a/lib/site_template/_config.yml b/lib/site_template/_config.yml index f5df9830..436d5999 100644 --- a/lib/site_template/_config.yml +++ b/lib/site_template/_config.yml @@ -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/ diff --git a/test/test_configuration.rb b/test/test_configuration.rb index febc0cbe..9602c5c3 100644 --- a/test/test_configuration.rb +++ b/test/test_configuration.rb @@ -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/"