From 706cc445863ff99d8605257a43e7bbd633c604c8 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 28 Feb 2010 18:48:59 -0800 Subject: put switch parsing for config.ru into Unicorn.builder This lets us reuse code for Zbatery and Rainbows!, too. --- bin/unicorn | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'bin') diff --git a/bin/unicorn b/bin/unicorn index 0da0869..7c65590 100755 --- a/bin/unicorn +++ b/bin/unicorn @@ -111,16 +111,9 @@ end ru = ARGV[0] || "config.ru" abort "configuration file #{ru} not found" unless File.exist?(ru) -if ru =~ /\.ru$/ - # parse embedded command-line options in config.ru comments - if File.open(ru, "rb") { |fp| fp.sysread(fp.stat.size) } =~ /^#\\(.*)/ - opts.parse! $1.split(/\s+/) - end -end - +app = Unicorn.builder(ru, opts) require 'pp' if $DEBUG -app = Unicorn.builder(ru) listeners << "#{host}:#{port}" if set_listener if $DEBUG -- cgit v1.2.3-24-ge0c7