Merge pull request #169 from bhollis/master

Include .htaccess files when building a site
This commit is contained in:
Thomas Reynolds 2011-11-27 21:16:17 -08:00
commit a14853e2bf
3 changed files with 3 additions and 1 deletions

View file

@ -15,6 +15,7 @@ Feature: Builder
Then "spaces in file.html" should exist at "test-app" and include "spaces" Then "spaces in file.html" should exist at "test-app" and include "spaces"
Then "images/Read me (example).txt" should exist at "test-app" Then "images/Read me (example).txt" should exist at "test-app"
Then "images/Child folder/regular_file(example).txt" should exist at "test-app" Then "images/Child folder/regular_file(example).txt" should exist at "test-app"
Then ".htaccess" should exist at "test-app"
Scenario: Build glob Scenario: Build glob
Given a built app at "glob-app" with flags "--glob '*.css'" Given a built app at "glob-app" with flags "--glob '*.css'"

View file

@ -0,0 +1 @@
# I'm an htaccess file!

View file

@ -101,7 +101,7 @@ module Middleman::Sitemap
def touch_file(file) def touch_file(file)
return false if file == @source || return false if file == @source ||
file.match(/^\./) || file.match(/^\./) ||
file.match(/\/\./) || (file.match(/\/\./) && !file.match(/\/\.htaccess/)) ||
(file.match(/\/_/) && !file.match(/\/__/)) || (file.match(/\/_/) && !file.match(/\/__/)) ||
File.directory?(file) File.directory?(file)