diff options
author | Eric Wong <normalperson@yhbt.net> | 2009-02-20 11:16:29 -0800 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2009-02-21 04:23:36 -0800 |
commit | b8697b5fb102049f341e710204dfafeecfedc308 (patch) | |
tree | de75189d51d00c6d3b2c5ec1cfff4ce352d50571 | |
parent | 39bdfa57791248e6dd72aa20c9a539c7ff5d4ccb (diff) | |
download | unicorn-b8697b5fb102049f341e710204dfafeecfedc308.tar.gz |
This will make setting some of this easier to deal with in the executable.
-rw-r--r-- | lib/unicorn.rb | 6 | ||||
-rw-r--r-- | lib/unicorn/const.rb | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/unicorn.rb b/lib/unicorn.rb index 7a2eda2..bb2b170 100644 --- a/lib/unicorn.rb +++ b/lib/unicorn.rb @@ -32,10 +32,12 @@ module Unicorn :umask => File.umask, }.freeze + DEFAULT_LOGGER = Logger.new(STDERR) + DEFAULTS = { :timeout => 60, - :listeners => %w(0.0.0.0:8080), - :logger => Logger.new(STDERR), + :listeners => [ Const::DEFAULT_LISTEN ], + :logger => DEFAULT_LOGGER, :nr_workers => 1, :hot_config_file => nil, :after_fork => lambda { |server, worker_nr| diff --git a/lib/unicorn/const.rb b/lib/unicorn/const.rb index 4b3dcbf..46398e5 100644 --- a/lib/unicorn/const.rb +++ b/lib/unicorn/const.rb @@ -72,6 +72,10 @@ module Unicorn UNICORN_TMP_BASE="unicorn".freeze + DEFAULT_HOST = "0.0.0.0".freeze # default TCP listen host address + DEFAULT_PORT = "8080".freeze # default TCP listen port + DEFAULT_LISTEN = "#{DEFAULT_HOST}:#{DEFAULT_PORT}".freeze + # The standard empty 404 response for bad requests. Use Error4040Handler for custom stuff. ERROR_404_RESPONSE="HTTP/1.1 404 Not Found\r\nConnection: close\r\nServer: Unicorn #{UNICORN_VERSION}\r\n\r\nNOT FOUND".freeze |