about summary refs log tree commit homepage
diff options
context:
space:
mode:
-rwxr-xr-xbin/unicorn5
-rw-r--r--lib/unicorn.rb2
-rwxr-xr-xscript/isolate_for_tests2
-rw-r--r--test/exec/test_exec.rb1
4 files changed, 9 insertions, 1 deletions
diff --git a/bin/unicorn b/bin/unicorn
index 9962b58..01984f8 100755
--- a/bin/unicorn
+++ b/bin/unicorn
@@ -58,6 +58,11 @@ op = OptionParser.new("", 24, '  ') do |opts|
     ENV["RACK_ENV"] = e
   end
 
+  opts.on("-N", "--no-default-middleware",
+          "do not load middleware implied by RACK_ENV") do |e|
+    rackup_opts[:no_default_middleware] = true
+  end
+
   opts.on("-D", "--daemonize", "run daemonized in the background") do |d|
     rackup_opts[:daemonize] = !!d
   end
diff --git a/lib/unicorn.rb b/lib/unicorn.rb
index d96ff91..f0ceffe 100644
--- a/lib/unicorn.rb
+++ b/lib/unicorn.rb
@@ -49,6 +49,8 @@ module Unicorn
 
       pp({ :inner_app => inner_app }) if $DEBUG
 
+      return inner_app if op[:no_default_middleware]
+
       # return value, matches rackup defaults based on env
       # Unicorn does not support persistent connections, but Rainbows!
       # and Zbatery both do.  Users accustomed to the Rack::Server default
diff --git a/script/isolate_for_tests b/script/isolate_for_tests
index 3b3872b..d6f5913 100755
--- a/script/isolate_for_tests
+++ b/script/isolate_for_tests
@@ -19,7 +19,7 @@ pid = fork do
     gem 'raindrops', '0.10.0'
     gem 'kgio-monkey', '0.4.0'
     gem 'kgio', '2.8.0'
-    gem 'rack', '1.5.0'
+    gem 'rack', '1.5.1'
   end
 end
 _, status = Process.waitpid2(pid)
diff --git a/test/exec/test_exec.rb b/test/exec/test_exec.rb
index 1cee2b7..10a1bae 100644
--- a/test/exec/test_exec.rb
+++ b/test/exec/test_exec.rb
@@ -323,6 +323,7 @@ EOF
     # mobile phone or netbook on a slow connection :)
     assert lines.size <= 24, "help height fits in an ANSI terminal window"
     lines.each do |line|
+      line.chomp!
       assert line.size <= 80, "help width fits in an ANSI terminal window"
     end
   end