diff --git a/History.txt b/History.txt index 53bd41c6..180ba898 100644 --- a/History.txt +++ b/History.txt @@ -8,6 +8,7 @@ * Allow some special characters in highlight names * URL escape category names in URL generation (#360) * Fix error with limit_posts (#442) + * Properly select dotfile during directory scan (#363, #431, #377) == 0.11.2 / 2011-12-27 * Bug Fixes diff --git a/features/create_sites.feature b/features/create_sites.feature index 8496a4e2..438ee358 100644 --- a/features/create_sites.feature +++ b/features/create_sites.feature @@ -104,3 +104,9 @@ Feature: Create sites When I run jekyll Then the _site directory should exist And I should see "URL: /2020/01/31/entry2/" in "_site/index.html" + + Scenario: Basic site with whitelisted dotfile + Given I have an ".htaccess" file that contains "SomeDirective" + When I run jekyll + Then the _site directory should exist + And I should see "SomeDirective" in "_site/.htaccess" diff --git a/features/site_configuration.feature b/features/site_configuration.feature index 8d3bee5d..6935af3d 100644 --- a/features/site_configuration.feature +++ b/features/site_configuration.feature @@ -131,3 +131,15 @@ Feature: Site configuration And the "_site/2009/04/05/bananas.html" file should exist And the "_site/2009/04/01/oranges.html" file should exist And the "_site/2009/03/27/apples.html" file should not exist + + Scenario: Copy over normally excluded files when they are explicitly included + Given I have a ".gitignore" file that contains ".DS_Store" + And I have an ".htaccess" file that contains "SomeDirective" + And I have a configuration file with "include" set to: + | value | + | .gitignore | + | .foo | + When I run jekyll + Then the _site directory should exist + And I should see ".DS_Store" in "_site/.gitignore" + And the "_site/.htaccess" file should not exist diff --git a/lib/jekyll/site.rb b/lib/jekyll/site.rb index c47ccd2d..d394d7e1 100644 --- a/lib/jekyll/site.rb +++ b/lib/jekyll/site.rb @@ -124,7 +124,7 @@ module Jekyll # Returns nothing. def read_directories(dir = '') base = File.join(self.source, dir) - entries = Dir.chdir(base) { filter_entries(Dir['*']) } + entries = Dir.chdir(base) { filter_entries(Dir.entries('.')) } self.read_posts(dir)