From dc30ea27b35265783dcf2e9da1917c2079d86005 Mon Sep 17 00:00:00 2001 From: Thomas Reynolds Date: Sat, 17 Sep 2011 16:49:14 -0700 Subject: [PATCH] fix builder error --- fixtures/indexable-app/build/a_folder/needs_index.html | 1 - fixtures/indexable-app/build/leave_me_alone.html | 1 - fixtures/indexable-app/build/needs_index/index.html | 1 - fixtures/indexable-app/build/regular/index.html | 1 - lib/middleman/builder.rb | 4 ++-- lib/middleman/features/directory_indexes.rb | 5 +++++ 6 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 fixtures/indexable-app/build/a_folder/needs_index.html delete mode 100644 fixtures/indexable-app/build/leave_me_alone.html delete mode 100644 fixtures/indexable-app/build/needs_index/index.html delete mode 100644 fixtures/indexable-app/build/regular/index.html diff --git a/fixtures/indexable-app/build/a_folder/needs_index.html b/fixtures/indexable-app/build/a_folder/needs_index.html deleted file mode 100644 index 1eeec11b..00000000 --- a/fixtures/indexable-app/build/a_folder/needs_index.html +++ /dev/null @@ -1 +0,0 @@ -Indexable \ No newline at end of file diff --git a/fixtures/indexable-app/build/leave_me_alone.html b/fixtures/indexable-app/build/leave_me_alone.html deleted file mode 100644 index 163cebf8..00000000 --- a/fixtures/indexable-app/build/leave_me_alone.html +++ /dev/null @@ -1 +0,0 @@ -Stay away \ No newline at end of file diff --git a/fixtures/indexable-app/build/needs_index/index.html b/fixtures/indexable-app/build/needs_index/index.html deleted file mode 100644 index 1eeec11b..00000000 --- a/fixtures/indexable-app/build/needs_index/index.html +++ /dev/null @@ -1 +0,0 @@ -Indexable \ No newline at end of file diff --git a/fixtures/indexable-app/build/regular/index.html b/fixtures/indexable-app/build/regular/index.html deleted file mode 100644 index ea9503c0..00000000 --- a/fixtures/indexable-app/build/regular/index.html +++ /dev/null @@ -1 +0,0 @@ -Regular \ No newline at end of file diff --git a/lib/middleman/builder.rb b/lib/middleman/builder.rb index 2b19f34f..3d095732 100644 --- a/lib/middleman/builder.rb +++ b/lib/middleman/builder.rb @@ -35,10 +35,10 @@ module Middleman include Middleman::ThorActions def self.shared_rack - @shared_rack ||= begin + @shared_rack ||= begin mock = ::Rack::MockSession.new(SHARED_SERVER) sess = ::Rack::Test::Session.new(mock) - # sess.get("/") + response = sess.get("__middleman__") sess end end diff --git a/lib/middleman/features/directory_indexes.rb b/lib/middleman/features/directory_indexes.rb index 553fb411..a08f5761 100644 --- a/lib/middleman/features/directory_indexes.rb +++ b/lib/middleman/features/directory_indexes.rb @@ -5,16 +5,21 @@ module Middleman::Features::DirectoryIndexes app.extend ClassMethods app.build_reroute do |destination, request_path| + $stderr.puts "_: " + request_path index_ext = File.extname(app.settings.index_file) new_index_path = "/#{app.settings.index_file}" indexed_path = request_path.gsub(/\/$/, "") + index_ext + $stderr.puts "*: " + request_path if app.settings.ignored_directory_indexes.include?(request_path) + $stderr.puts "1: " + request_path false elsif request_path =~ /#{new_index_path}$/ + $stderr.puts "2: " + request_path false else + $stderr.puts "3: " + request_path [ destination.gsub(/#{index_ext.gsub(".", "\\.")}$/, new_index_path), request_path