Skip to content

Commit 9d70088

Browse files
committed
Properly select dotfiles during directory scan.
Fixes #363. Fixes #431. Fixes #377.
1 parent e27e255 commit 9d70088

4 files changed

Lines changed: 20 additions & 1 deletion

File tree

History.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* Allow some special characters in highlight names
99
* URL escape category names in URL generation (#360)
1010
* Fix error with limit_posts (#442)
11+
* Properly select dotfile during directory scan (#363, #431, #377)
1112

1213
== 0.11.2 / 2011-12-27
1314
* Bug Fixes

features/create_sites.feature

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,3 +104,9 @@ Feature: Create sites
104104
When I run jekyll
105105
Then the _site directory should exist
106106
And I should see "URL: /2020/01/31/entry2/" in "_site/index.html"
107+
108+
Scenario: Basic site with whitelisted dotfile
109+
Given I have an ".htaccess" file that contains "SomeDirective"
110+
When I run jekyll
111+
Then the _site directory should exist
112+
And I should see "SomeDirective" in "_site/.htaccess"

features/site_configuration.feature

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,15 @@ Feature: Site configuration
131131
And the "_site/2009/04/05/bananas.html" file should exist
132132
And the "_site/2009/04/01/oranges.html" file should exist
133133
And the "_site/2009/03/27/apples.html" file should not exist
134+
135+
Scenario: Copy over normally excluded files when they are explicitly included
136+
Given I have a ".gitignore" file that contains ".DS_Store"
137+
And I have an ".htaccess" file that contains "SomeDirective"
138+
And I have a configuration file with "include" set to:
139+
| value |
140+
| .gitignore |
141+
| .foo |
142+
When I run jekyll
143+
Then the _site directory should exist
144+
And I should see ".DS_Store" in "_site/.gitignore"
145+
And the "_site/.htaccess" file should not exist

lib/jekyll/site.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def read_layouts(dir = '')
124124
# Returns nothing.
125125
def read_directories(dir = '')
126126
base = File.join(self.source, dir)
127-
entries = Dir.chdir(base) { filter_entries(Dir['*']) }
127+
entries = Dir.chdir(base) { filter_entries(Dir.entries('.')) }
128128

129129
self.read_posts(dir)
130130

0 commit comments

Comments
 (0)