lib/capistrano/tasks/puma.cap in capistrano3-puma-0.5.1 vs lib/capistrano/tasks/puma.cap in capistrano3-puma-0.6.0

- old
+ new

@@ -9,12 +9,12 @@ set :puma_rackup, -> { File.join(current_path, 'config.ru') } set :puma_state, -> { File.join(shared_path, 'tmp', 'pids', 'puma.state') } set :puma_pid, -> { File.join(shared_path, 'tmp', 'pids', 'puma.pid') } set :puma_bind, -> { File.join('unix://', shared_path, 'tmp', 'sockets', 'puma.sock') } set :puma_conf, -> { File.join(shared_path, 'puma.rb') } - set :puma_access_log, -> { File.join(shared_path, 'log', 'puma_error.log') } - set :puma_error_log, -> { File.join(shared_path, 'log', 'puma_access.log') } + set :puma_access_log, -> { File.join(shared_path, 'log', 'puma_access.log') } + set :puma_error_log, -> { File.join(shared_path, 'log', 'puma_error.log') } set :puma_init_active_record, false set :puma_preload_app, true # Rbenv and RVM integration set :rbenv_map_bins, fetch(:rbenv_map_bins).to_a.concat(%w{ puma pumactl }) @@ -35,11 +35,11 @@ task :start do on roles (fetch(:puma_role)) do within current_path do with rack_env: fetch(:puma_env) do - execute :bundle, 'exec', :puma, "-C #{fetch(:puma_conf)}" + execute :bundle, 'exec', :puma, "-C #{fetch(:puma_conf)} --daemon" end end end end @@ -75,11 +75,11 @@ if test "[ -f #{fetch(:puma_pid)} ]" and test "kill -0 $( cat #{fetch(:puma_pid)} )" # NOTE pid exist but state file is nonsense, so ignore that case execute :bundle, 'exec', :pumactl, "-S #{fetch(:puma_state)} #{command}" else # Puma is not running or state file is not present : Run it - execute :bundle, 'exec', :puma, "-C #{fetch(:puma_conf)}" + execute :bundle, 'exec', :puma, "-C #{fetch(:puma_conf)} --daemon" end end end end end @@ -107,23 +107,17 @@ end after 'deploy:finished', 'puma:smart_restart' def puma_workers - fetch(:puma_workers) || 0 + fetch(:puma_workers, 0) end - def puma_bind - case fetch(:puma_bind) - when Array - fetch(:puma_bind).collect do |bind| - "bind '#{bind}'" - end.join("\n") - else - "bind '#{fetch(:puma_bind)}'" - end + Array(fetch(:puma_bind)).collect do |bind| + "bind '#{bind}'" + end.join("\n") end def template_puma(from, to, role) [ "lib/capistrano/templates/#{from}-#{role.hostname}-#{fetch(:stage)}.rb",