Make -N/--no-default-middleware option work
authorMicah Chalmer <micah@micahchalmer.net>
Fri, 7 Jun 2013 03:03:36 +0000 (23:03 -0400)
committerEric Wong <normalperson@yhbt.net>
Fri, 7 Jun 2013 09:16:57 +0000 (09:16 +0000)
commit56b0c0c3d26304beeef54d8fe95bead97424f147
treefafd4255bcdb39fc8c3f6482174aad77029e1134
parent421f5a8573484b1203fceebc65aee5d011d63c63
Make -N/--no-default-middleware option work

This fixes the -N (a.k.a. --no-defaut-middleware) option, which
was not working.  The problem was that Unicorn::Configurator::RACKUP
is cleared before the lambda returned by Unicorn.builder is run,
which means that checking whether the :no_default_middleware option
was set from the lambda could not detect anything.  This patch copies
it to a local variable that won't get clobbered, restoring the feature.

[ew: squashed test commit into the fix, whitespace fixes]

Signed-off-by: Eric Wong <normalperson@yhbt.net>
lib/unicorn.rb
t/fails-rack-lint.ru [new file with mode: 0644]
t/t0300-no-default-middleware.sh [new file with mode: 0644]