diff options
author | Eric Wong <normalperson@yhbt.net> | 2010-12-26 07:29:38 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2010-12-26 07:35:14 +0000 |
commit | 51f30bf454e82f33443fe4a7f2e0496103c5ec6f (patch) | |
tree | 3bd00af4757f6dfa50575a2a8c75a320702847ee /lib/unicorn/http_server.rb | |
parent | 45f0220ab13ec67150b3226a83437356f141eefd (diff) | |
download | unicorn-51f30bf454e82f33443fe4a7f2e0496103c5ec6f.tar.gz |
We can just use a begin block at startup, this also makes life easier on RDoc.
Diffstat (limited to 'lib/unicorn/http_server.rb')
-rw-r--r-- | lib/unicorn/http_server.rb | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/lib/unicorn/http_server.rb b/lib/unicorn/http_server.rb index 6f02f29..5323872 100644 --- a/lib/unicorn/http_server.rb +++ b/lib/unicorn/http_server.rb @@ -73,19 +73,17 @@ class Unicorn::HttpServer # Unicorn::HttpServer::START_CTX[0] = "/home/bofh/1.9.2/bin/unicorn" START_CTX = { :argv => ARGV.map { |arg| arg.dup }, - :cwd => lambda { - # favor ENV['PWD'] since it is (usually) symlink aware for - # Capistrano and like systems - begin - a = File.stat(pwd = ENV['PWD']) - b = File.stat(Dir.pwd) - a.ino == b.ino && a.dev == b.dev ? pwd : Dir.pwd - rescue - Dir.pwd - end - }.call, 0 => $0.dup, } + # We favor ENV['PWD'] since it is (usually) symlink aware for Capistrano + # and like systems + START_CTX[:cwd] = begin + a = File.stat(pwd = ENV['PWD']) + b = File.stat(Dir.pwd) + a.ino == b.ino && a.dev == b.dev ? pwd : Dir.pwd + rescue + Dir.pwd + end # Creates a working server on host:port (strange things happen if # port isn't a Number). Use HttpServer::run to start the server and |