lib/tasks/capistrano_tasks.rb in switches-0.1.4 vs lib/tasks/capistrano_tasks.rb in switches-0.1.5
- old
+ new
@@ -1,9 +1,9 @@
# assumes you've got roles, deploy_to, rails_env
require 'pp'
-require 'activesupport'
+require 'active_support'
require 'zlib'
# basically { :a => 1, :b => 2 }.eql?({ :b => 2, :a => 1}) => true
class StrictComparableHash < Hash
def eql?(other)
@@ -25,10 +25,10 @@
task cmd.to_sym, :roles => :app do
upload File.join(File.dirname(__FILE__), '..', '..', 'lib', 'tasks', 'switches.rake'), File.join(deploy_to, 'current', 'lib', 'tasks', 'switches.rake')
# download switches xml from servers
raw_input = Hash.new
- run "cd #{deploy_to}/current; rake --silent s:#{cmd}#{"[#{ENV['ARG']}]" if ENV['ARG'].present?} RAILS_ENV=#{rails_env}; true" do |channel, stream, data|
+ run "cd #{deploy_to}/current; rake --silent s:#{cmd}#{"[#{ENV['ARG']}]" if ENV['ARG'].present?} SWITCHES_XML=true RAILS_ENV=#{rails_env}; true" do |channel, stream, data|
server = channel[:server]
server_identifier = gfs ? server.host : "#{server.host}:#{server.port}".chomp(':')
raw_input[server_identifier] ||= Array.new
raw_input[server_identifier] << data
end