fix builder error
This commit is contained in:
parent
4fe75da020
commit
dc30ea27b3
|
@ -1 +0,0 @@
|
||||||
Indexable
|
|
|
@ -1 +0,0 @@
|
||||||
Stay away
|
|
|
@ -1 +0,0 @@
|
||||||
Indexable
|
|
|
@ -1 +0,0 @@
|
||||||
Regular
|
|
|
@ -38,7 +38,7 @@ module Middleman
|
||||||
@shared_rack ||= begin
|
@shared_rack ||= begin
|
||||||
mock = ::Rack::MockSession.new(SHARED_SERVER)
|
mock = ::Rack::MockSession.new(SHARED_SERVER)
|
||||||
sess = ::Rack::Test::Session.new(mock)
|
sess = ::Rack::Test::Session.new(mock)
|
||||||
# sess.get("/")
|
response = sess.get("__middleman__")
|
||||||
sess
|
sess
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -5,16 +5,21 @@ module Middleman::Features::DirectoryIndexes
|
||||||
app.extend ClassMethods
|
app.extend ClassMethods
|
||||||
|
|
||||||
app.build_reroute do |destination, request_path|
|
app.build_reroute do |destination, request_path|
|
||||||
|
$stderr.puts "_: " + request_path
|
||||||
index_ext = File.extname(app.settings.index_file)
|
index_ext = File.extname(app.settings.index_file)
|
||||||
new_index_path = "/#{app.settings.index_file}"
|
new_index_path = "/#{app.settings.index_file}"
|
||||||
|
|
||||||
indexed_path = request_path.gsub(/\/$/, "") + index_ext
|
indexed_path = request_path.gsub(/\/$/, "") + index_ext
|
||||||
|
|
||||||
|
$stderr.puts "*: " + request_path
|
||||||
if app.settings.ignored_directory_indexes.include?(request_path)
|
if app.settings.ignored_directory_indexes.include?(request_path)
|
||||||
|
$stderr.puts "1: " + request_path
|
||||||
false
|
false
|
||||||
elsif request_path =~ /#{new_index_path}$/
|
elsif request_path =~ /#{new_index_path}$/
|
||||||
|
$stderr.puts "2: " + request_path
|
||||||
false
|
false
|
||||||
else
|
else
|
||||||
|
$stderr.puts "3: " + request_path
|
||||||
[
|
[
|
||||||
destination.gsub(/#{index_ext.gsub(".", "\\.")}$/, new_index_path),
|
destination.gsub(/#{index_ext.gsub(".", "\\.")}$/, new_index_path),
|
||||||
request_path
|
request_path
|
||||||
|
|
Loading…
Reference in a new issue