From a5064bc0bb549ca60e3e4d5f1a912bafa46c7f5f Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 24 Feb 2010 15:04:15 -0800 Subject: switch to Unicorn.builder, depend on Unicorn 0.97.0+ The Unicorn.builder helper will help us avoid namespace conflicts inside config.ru, allowing us to pass tests. While we're at it, port some tests over from the latest unicorn.git for dealing with bad configs. --- bin/rainbows | 34 ++-------------------------------- 1 file changed, 2 insertions(+), 32 deletions(-) (limited to 'bin') diff --git a/bin/rainbows b/bin/rainbows index 77059ef..ba7ee7f 100644 --- a/bin/rainbows +++ b/bin/rainbows @@ -122,37 +122,7 @@ end require 'pp' if $DEBUG -app = lambda do || - # require Rack as late as possible in case $LOAD_PATH is modified - # in config.ru or command-line - inner_app = case config - when /\.ru$/ - raw = File.open(config, "rb") { |fp| fp.sysread(fp.stat.size) } - raw.sub!(/^__END__\n.*/, '') - eval("Rack::Builder.new {(#{raw}\n)}.to_app", nil, config) - else - require config - Object.const_get(File.basename(config, '.rb').capitalize) - end - pp({ :inner_app => inner_app }) if $DEBUG - case ENV["RACK_ENV"] - when "development" - Rack::Builder.new do - use Rack::CommonLogger, $stderr - use Rack::ShowExceptions - use Rack::Lint - run inner_app - end.to_app - when "deployment" - Rack::Builder.new do - use Rack::CommonLogger, $stderr - run inner_app - end.to_app - else - inner_app - end -end - +app = Unicorn.builder(config) listeners << "#{host}:#{port}" if set_listener if $DEBUG @@ -163,5 +133,5 @@ if $DEBUG }) end -Unicorn::Launcher.daemonize! if daemonize +Unicorn::Launcher.daemonize!(options) if daemonize Rainbows.run(app, options) -- cgit v1.2.3-24-ge0c7