From 0e2243e6209bc4de7ff964275ddb661f0002d714 Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 31 Jan 2011 15:21:13 -0800 Subject: [PATCH] use capture and captures to detect thins in /service --- Gemfile | 7 +++++-- config/deploy.rb | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index 206f01885..66bc2ab38 100644 --- a/Gemfile +++ b/Gemfile @@ -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' diff --git a/config/deploy.rb b/config/deploy.rb index 8fb72797a..ad13c183a 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -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