Commit 073fc04e by Tensho Committed by Andrew Babichev

Cleanup

parent 8665c70d
# coding: utf-8
lib = File.expand_path('../lib', __FILE__) lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'capistrano/sneakers/version' require 'capistrano/sneakers/version'
......
namespace :load do namespace :load do
task :defaults do task :defaults do
set :sneakers_default_hooks, -> { true } set :sneakers_default_hooks, -> { true }
...@@ -18,9 +17,7 @@ namespace :load do ...@@ -18,9 +17,7 @@ namespace :load do
end end
end end
namespace :deploy do namespace :deploy do
before :starting, :check_sneakers_hooks do before :starting, :check_sneakers_hooks do
invoke 'sneakers:add_default_hooks' if fetch(:sneakers_default_hooks) invoke 'sneakers:add_default_hooks' if fetch(:sneakers_default_hooks)
end end
...@@ -31,7 +28,6 @@ namespace :deploy do ...@@ -31,7 +28,6 @@ namespace :deploy do
end end
namespace :sneakers do namespace :sneakers do
def for_each_sneakers_process(reverse = false, &block) def for_each_sneakers_process(reverse = false, &block)
pids = processes_sneakers_pids pids = processes_sneakers_pids
pids.reverse! if reverse pids.reverse! if reverse
...@@ -196,7 +192,9 @@ namespace :sneakers do ...@@ -196,7 +192,9 @@ namespace :sneakers do
on roles fetch(:sneakers_role) do |role| on roles fetch(:sneakers_role) do |role|
as_sneakers_user(role) do as_sneakers_user(role) do
for_each_sneakers_process do |pid_file, idx| for_each_sneakers_process do |pid_file, idx|
start_sneakers(pid_file, idx) unless sneakers_pid_process_exists?(pid_file) unless sneakers_pid_process_exists?(pid_file)
start_sneakers(pid_file, idx)
end
end end
end end
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment