From ecbff236982f0ac94555171f86cee217929a978a Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 23 Feb 2009 16:10:02 -0800 Subject: Allow overriding :directory or via -C/--directory This allows Unicorn to be constantly started in symlink paths such as the ones Capistrano creates (e.g. "/u/apps/$app/current") --- lib/unicorn/configurator.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/unicorn/configurator.rb') diff --git a/lib/unicorn/configurator.rb b/lib/unicorn/configurator.rb index 9457480..ebdcba6 100644 --- a/lib/unicorn/configurator.rb +++ b/lib/unicorn/configurator.rb @@ -20,6 +20,7 @@ module Unicorn :before_fork => lambda { |server, worker_nr| server.logger.info("worker=#{worker_nr} spawning...") }, + :directory => nil, :pid => nil, :backlog => 1024, } @@ -137,6 +138,10 @@ module Unicorn @set[:pid] = path end + def directory(path) + @set[:directory] = path ? File.expand_path(path) : nil + end + private def set_hook(var, my_proc) #:nodoc: -- cgit v1.2.3-24-ge0c7