From 0cc00a74b48a2b6b72924e2d91361cbd37c5c4b1 Mon Sep 17 00:00:00 2001 From: Ben Hollis Date: Sun, 27 Nov 2011 20:22:51 -0800 Subject: [PATCH] Include .htaccess files when building a site. --- features/builder.feature | 1 + fixtures/test-app/source/.htaccess | 1 + lib/middleman/sitemap/store.rb | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 fixtures/test-app/source/.htaccess diff --git a/features/builder.feature b/features/builder.feature index 7550153e..185e5eff 100644 --- a/features/builder.feature +++ b/features/builder.feature @@ -15,6 +15,7 @@ Feature: Builder 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/Child folder/regular_file(example).txt" should exist at "test-app" + Then ".htaccess" should exist at "test-app" Scenario: Build glob Given a built app at "glob-app" with flags "--glob '*.css'" diff --git a/fixtures/test-app/source/.htaccess b/fixtures/test-app/source/.htaccess new file mode 100644 index 00000000..875bc5c4 --- /dev/null +++ b/fixtures/test-app/source/.htaccess @@ -0,0 +1 @@ +# I'm an htaccess file! \ No newline at end of file diff --git a/lib/middleman/sitemap/store.rb b/lib/middleman/sitemap/store.rb index ff44fe12..c684eab5 100644 --- a/lib/middleman/sitemap/store.rb +++ b/lib/middleman/sitemap/store.rb @@ -101,7 +101,7 @@ module Middleman::Sitemap def touch_file(file) return false if file == @source || file.match(/^\./) || - file.match(/\/\./) || + (file.match(/\/\./) && !file.match(/\/\.htaccess/)) || (file.match(/\/_/) && !file.match(/\/__/)) || File.directory?(file)