about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2013-01-29 11:44:06 +0800
committerEric Wong <normalperson@yhbt.net>2013-01-29 04:28:01 +0000
commita552fb90230eb65c28897398c7786dc9a13446ca (patch)
tree56a1158d14c49831e8fbfcc4fe15ec37202a059f
parent49f70632e2f4a9b84fd4fced7439d0844fed1bbd (diff)
downloadrainbows-a552fb90230eb65c28897398c7786dc9a13446ca.tar.gz
This would prevent Unicorn (Rainbows) from adding default middleware,
as if RACK_ENV were always none. (not development nor deployment)

This is implemented in Unicorn, so we only need to update
the option parser here.

Discussion thread on Unicorn mailing list:
http://rubyforge.org/pipermail/mongrel-unicorn/2013-January/001675.html

Signed-off-by: Eric Wong <normalperson@yhbt.net>
-rw-r--r--bin/rainbows5
1 files changed, 5 insertions, 0 deletions
diff --git a/bin/rainbows b/bin/rainbows
index 878b3f2..f5ddaa7 100644
--- a/bin/rainbows
+++ b/bin/rainbows
@@ -59,6 +59,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