capistrano deploy: fixed multiple thin detection

This commit is contained in:
Alessio Caiazza 2012-02-04 18:11:34 +01:00
parent 8632c8c40b
commit 67e2ca44fc

View file

@ -47,7 +47,10 @@ namespace :deploy do
task :restart do task :restart do
thins = capture_svstat "/service/thin*" thins = capture_svstat "/service/thin*"
matches = thins.match(/(thin_\d+):/).captures matches = thins.split("\n").inject([]) do |list, line|
m = line.match(/(thin_\d+):/)
list << m.captures[0] unless m.nil?
end
matches.each_with_index do |thin, index| matches.each_with_index do |thin, index|
unless index == 0 unless index == 0