Files

Class/Module Index [+]

Quicksearch

Capistrano::Configuration::Actions::FileTransfer

Public Instance Methods

download(from, to, options={}, &block) click to toggle source
# File lib/capistrano/configuration/actions/file_transfer.rb, line 33
def download(from, to, options={}, &block)
  transfer(:down, from, to, options, &block)
end
get(remote_path, path, options={}, &block) click to toggle source

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
def get(remote_path, path, options={}, &block)
  download(remote_path, path, options.merge(:once => true), &block)
end
put(data, path, options={}) click to toggle source

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
def put(data, path, options={})
  opts = options.dup
  upload(StringIO.new(data), path, opts)
end
transfer(direction, from, to, options={}, &block) click to toggle source
# File lib/capistrano/configuration/actions/file_transfer.rb, line 37
def transfer(direction, from, to, options={}, &block)
  if dry_run
    return logger.debug "transfering: #{[direction, from, to] * ', '}"
  end
  execute_on_servers(options) do |servers|
    targets = servers.map { |s| sessions[s] }
      Transfer.process(direction, from, to, targets, options.merge(:logger => logger), &block)
  end
end
upload(from, to, options={}, &block) click to toggle source
# File lib/capistrano/configuration/actions/file_transfer.rb, line 24
def upload(from, to, options={}, &block)
  mode = options.delete(:mode)
  transfer(:up, from, to, options, &block)
  if mode
    mode = mode.is_a?(Numeric) ? mode.to_s(8) : mode.to_s
    run "chmod #{mode} #{to}", options
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.