From 0792b37d5e28d3ea1585d5837682cde4d0319a8a Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 8 Apr 2010 17:37:42 -0700 Subject: bin/*: remove unnecessary listeners variable --- bin/unicorn | 7 +++---- bin/unicorn_rails | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'bin') diff --git a/bin/unicorn b/bin/unicorn index 658d27c..beece97 100755 --- a/bin/unicorn +++ b/bin/unicorn @@ -5,8 +5,7 @@ require 'optparse' ENV["RACK_ENV"] ||= "development" daemonize = false -listeners = [] -options = { :listeners => listeners } +options = { :listeners => [] } host, port = Unicorn::Const::DEFAULT_HOST, Unicorn::Const::DEFAULT_PORT set_listener = false @@ -81,7 +80,7 @@ opts = OptionParser.new("", 24, ' ') do |opts| "listen on HOST:PORT or PATH", "this may be specified multiple times", "(default: #{Unicorn::Const::DEFAULT_LISTEN})") do |address| - listeners << address + options[:listeners] << address end opts.on("-c", "--config-file FILE", "Unicorn-specific config file") do |f| @@ -112,7 +111,7 @@ ru = ARGV[0] || "config.ru" abort "configuration file #{ru} not found" unless File.exist?(ru) app = Unicorn.builder(ru, opts) -listeners << "#{host}:#{port}" if set_listener +options[:listeners] << "#{host}:#{port}" if set_listener if $DEBUG require 'pp' diff --git a/bin/unicorn_rails b/bin/unicorn_rails index 184056e..72ab288 100755 --- a/bin/unicorn_rails +++ b/bin/unicorn_rails @@ -5,8 +5,7 @@ require 'optparse' require 'fileutils' daemonize = false -listeners = [] -options = { :listeners => listeners } +options = { :listeners => [] } host, port = Unicorn::Const::DEFAULT_HOST, Unicorn::Const::DEFAULT_PORT set_listener = false ENV['RAILS_ENV'] ||= "development" @@ -70,7 +69,7 @@ opts = OptionParser.new("", 24, ' ') do |opts| "listen on HOST:PORT or PATH", "this may be specified multiple times", "(default: #{Unicorn::Const::DEFAULT_LISTEN})") do |address| - listeners << address + options[:listeners] << address end opts.on("-c", "--config-file FILE", "Unicorn-specific config file") do |f| @@ -181,7 +180,7 @@ def rails_builder(ru, daemonize) end app = rails_builder(ru, daemonize) -listeners << "#{host}:#{port}" if set_listener +options[:listeners] << "#{host}:#{port}" if set_listener if $DEBUG require 'pp' -- cgit v1.2.3-24-ge0c7