Sha256: 574adcbb1a6f81591e66e39926ead3017d4abf871861b09c08094cbcfbfa3000
Contents?: true
Size: 580 Bytes
Versions: 29
Compression:
Stored size: 580 Bytes
Contents
# role = :app def with_role(role, &block) original, ENV['HOSTS'] = ENV['HOSTS'], find_servers(:roles => role).map{|d| d.host}.join(",") begin yield ensure ENV['HOSTS'] = original end end # options = { :user => 'xxxxx', :password => 'xxxxx' } def with_credentials(options={}, &block) original_username, original_password = user, password begin set :user, options[:user] || original_username set :password, options[:password] || original_password yield ensure set :user, original_username set :password, original_password end end
Version data entries
29 entries across 29 versions & 3 rubygems