From ecaa8be47db5bc9cd1da445836f889acc0b1f660 Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Tue, 29 Jan 2013 12:06:00 +0800 Subject: [PATCH] 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 --- bin/zbatery | 5 +++++ 1 file changed, 5 insertions(+) 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 -- 2.11.4.GIT