From c121c407df36af20a399f310fb3339ad2efbdbff Mon Sep 17 00:00:00 2001 From: Steven Sloan Date: Fri, 18 Jan 2013 20:13:49 -0500 Subject: [PATCH] also "build" .htpasswd files --- middleman-core/features/builder.feature | 1 + middleman-core/fixtures/large-build-app/source/.htpasswd | 1 + middleman-core/lib/middleman-core/cli/build.rb | 2 +- middleman-core/lib/middleman-core/sitemap.rb | 2 +- middleman-more/features/directory_index.feature | 1 + middleman-more/fixtures/indexable-app/source/.htpasswd | 1 + 6 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 middleman-core/fixtures/large-build-app/source/.htpasswd create mode 100644 middleman-more/fixtures/indexable-app/source/.htpasswd diff --git a/middleman-core/features/builder.feature b/middleman-core/features/builder.feature index b3a19344..25f686e9 100644 --- a/middleman-core/features/builder.feature +++ b/middleman-core/features/builder.feature @@ -14,6 +14,7 @@ Feature: Builder | images/Read me (example).txt | | images/Child folder/regular_file(example).txt | | .htaccess | + | .htpasswd | | feed.xml | Then the following files should not exist: | _partial | diff --git a/middleman-core/fixtures/large-build-app/source/.htpasswd b/middleman-core/fixtures/large-build-app/source/.htpasswd new file mode 100644 index 00000000..76672b00 --- /dev/null +++ b/middleman-core/fixtures/large-build-app/source/.htpasswd @@ -0,0 +1 @@ +# .htpasswd \ No newline at end of file diff --git a/middleman-core/lib/middleman-core/cli/build.rb b/middleman-core/lib/middleman-core/cli/build.rb index ddbb6f1b..6cea9d70 100644 --- a/middleman-core/lib/middleman-core/cli/build.rb +++ b/middleman-core/lib/middleman-core/cli/build.rb @@ -220,7 +220,7 @@ module Middleman::Cli paths = ::Middleman::Util.all_files_under(@destination) @cleaning_queue += paths.select do |path| - !path.to_s.match(/\/\./) || path.to_s.match(/\.htaccess/) + !path.to_s.match(/\/\./) || path.to_s.match(/\.htaccess|\.htpasswd/) end end diff --git a/middleman-core/lib/middleman-core/sitemap.rb b/middleman-core/lib/middleman-core/sitemap.rb index a5693630..341c1fd9 100644 --- a/middleman-core/lib/middleman-core/sitemap.rb +++ b/middleman-core/lib/middleman-core/sitemap.rb @@ -29,7 +29,7 @@ module Middleman # Files starting with an dot, but not .htaccess :source_dotfiles => proc { |file| - file.match(%r{/\.}) && !file.match(%r{/\.htaccess}) + file.match(%r{/\.}) && !file.match(%r{/\.htaccess|\.htpasswd}) }, # Files starting with an underscore, but not a double-underscore diff --git a/middleman-more/features/directory_index.feature b/middleman-more/features/directory_index.feature index 0a7db97b..556e1d8b 100644 --- a/middleman-more/features/directory_index.feature +++ b/middleman-more/features/directory_index.feature @@ -11,6 +11,7 @@ Feature: Directory Index | wildcard_leave_me_alone.html | | regular/index.html | | .htaccess | + | .htpasswd | Then the following files should not exist: | egular/index/index.html | | needs_index.html | diff --git a/middleman-more/fixtures/indexable-app/source/.htpasswd b/middleman-more/fixtures/indexable-app/source/.htpasswd new file mode 100644 index 00000000..76672b00 --- /dev/null +++ b/middleman-more/fixtures/indexable-app/source/.htpasswd @@ -0,0 +1 @@ +# .htpasswd \ No newline at end of file