# File lib/capistrano/configuration/actions/file_transfer.rb, line 33 33: def download(from, to, options={}, &block) 34: transfer(:down, from, to, options, &block) 35: end
Get file remote_path from FIRST server targeted by the current task and transfer it to local machine as path.
get “#{deploy_to}/current/log/production.log“, “log/production.log.web“
# File lib/capistrano/configuration/actions/file_transfer.rb, line 20 20: def get(remote_path, path, options={}, &block) 21: download(remote_path, path, options.merge(:once => true), &block) 22: end
Store the given data at the given location on all servers targetted by the current task. If :mode is specified it is used to set the mode on the file.
# File lib/capistrano/configuration/actions/file_transfer.rb, line 11 11: def put(data, path, options={}) 12: opts = options.dup 13: upload(StringIO.new(data), path, opts) 14: end
# File lib/capistrano/configuration/actions/file_transfer.rb, line 37 37: def transfer(direction, from, to, options={}, &block) 38: if dry_run 39: return logger.debug "transfering: #{[direction, from, to] * ', '}" 40: end 41: execute_on_servers(options) do |servers| 42: targets = servers.map { |s| sessions[s] } 43: Transfer.process(direction, from, to, targets, options.merge(:logger => logger), &block) 44: end 45: end
# File lib/capistrano/configuration/actions/file_transfer.rb, line 24 24: def upload(from, to, options={}, &block) 25: mode = options.delete(:mode) 26: transfer(:up, from, to, options, &block) 27: if mode 28: mode = mode.is_a?(Numeric) ? mode.to_s(8) : mode.to_s 29: run "chmod #{mode} #{to}", options 30: end 31: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.