about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2013-01-29 12:06:00 +0800
committerEric Wong <normalperson@yhbt.net>2013-01-29 04:17:37 +0000
commitecaa8be47db5bc9cd1da445836f889acc0b1f660 (patch)
tree93eef36b5f0177a47ddf8a54f4f4af506c70a34d
parent329f878276ec90c6edfd2d6a07ab6d67835e0e2f (diff)
downloadzbatery-ecaa8be47db5bc9cd1da445836f889acc0b1f660.tar.gz
Add -N or --no-default-middleware option.
This would prevent Unicorn (Zbatery) 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
-rwxr-xr-xbin/zbatery5
1 files changed, 5 insertions, 0 deletions
diff --git a/bin/zbatery b/bin/zbatery
index 99ca46e..392e5c3 100755
--- a/bin/zbatery
+++ b/bin/zbatery
@@ -59,6 +59,11 @@ opts = 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