use capture and captures to detect thins in /service

This commit is contained in:
Raphael 2011-01-31 15:21:13 -08:00
parent e3a5102624
commit 0e2243e620
2 changed files with 7 additions and 4 deletions

View file

@ -30,8 +30,6 @@ gem 'roxml', :git => 'git://github.com/Empact/roxml.git', :ref => '7ea9a9ffd2338
gem 'addressable', '2.2.2', :require => 'addressable/uri'
gem 'json', '1.4.6'
gem 'http_accept_language', :git => 'git://github.com/iain/http_accept_language.git', :ref => '0b78aa7849fc90cf9e12'
gem 'capistrano', '2.5.19', :require => false
gem 'capistrano-ext', '1.2.1', :require => false
gem 'thin', '1.2.7', :require => false
@ -52,6 +50,11 @@ gem 'cloudfiles', '1.4.10', :require => false
gem 'resque', '1.10.0'
gem 'SystemTimer', '1.2.1' unless RUBY_VERSION.include? '1.9'
group :development do
gem 'capistrano', '2.5.19', :require => false
gem 'capistrano-ext', '1.2.1', :require => false
end
group :test, :development do
gem 'factory_girl_rails', :require => false
gem 'ruby-debug19' if RUBY_VERSION.include? '1.9'

View file

@ -35,8 +35,8 @@ namespace :deploy do
end
task :restart do
thins = run "svstat /service/thin*"
matches = thins.match(/(thin_\d+)/).to_a
thins = capture "svstat /service/thin*"
matches = thins.match(/(thin_\d+):/).captures
matches.each_with_index do |thin, index|
unless index == 0