From baf1c04b03c496fcb02dcdeee4b2d328be806978 Mon Sep 17 00:00:00 2001 From: Davide D'Agostino Date: Fri, 20 Jan 2012 10:06:00 +0100 Subject: [PATCH] Fix issue #6 --- lib/do/commands.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/do/commands.rb b/lib/do/commands.rb index e5a2fd6..013af55 100644 --- a/lib/do/commands.rb +++ b/lib/do/commands.rb @@ -15,8 +15,8 @@ def servers def remotes @_remotes ||= begin - name = ARGV[0] - servers.select { |s| s.name.to_s == name } + servers.select { |s| s.role.to_s == name } + names = ARGV[0].split('+') + servers.select { |s| names.include?(s.name.to_s) } | servers.select { |s| names.include?(s.role.to_s) } end end alias :remote :remotes @@ -107,11 +107,11 @@ def server(name, host, user, options={}) set current.name, current set current.role, servers.select { |s| s.role == current.role } if current.role task name do |opts, b| - @_current_server = servers.find { |s| s.name == current.name } + server_was, @_current_server = @_current_server, servers.find { |s| s.name == current.name } begin b.arity == 1 ? b.call(opts) : b.call ensure - @_current_server = nil + @_current_server = server_was end end end