Module: Capistrano::Configuration::Actions::FileTransfer

### Home Classes Methods

### In Files

- lib/capistrano/configuration/actions/file_transfer.rb

### Methods

- #download
- #get
- #put
- #transfer
- #upload

### Files

- help.txt

### Class/Module Index

Quicksearch

- Capistrano
- Capistrano::CLI
- Capistrano::CLI::Execute
- Capistrano::CLI::Execute::ClassMethods
- Capistrano::CLI::Help
- Capistrano::CLI::Options
- Capistrano::CLI::Options::ClassMethods
- Capistrano::CLI::UI
- Capistrano::CLI::UI::ClassMethods
- Capistrano::Callback
- Capistrano::Command
- Capistrano::Command::Tree
- Capistrano::Command::Tree::Branch
- Capistrano::Command::Tree::ConditionBranch
- Capistrano::Command::Tree::ConditionBranch::Evaluator
- Capistrano::Command::Tree::ElseBranch
- Capistrano::Configuration
- Capistrano::Configuration::Actions
- Capistrano::Configuration::Actions::FileTransfer
- Capistrano::Configuration::Actions::Inspect
- Capistrano::Configuration::Actions::Invocation
- Capistrano::Configuration::Actions::Invocation::ClassMethods
- Capistrano::Configuration::AliasTask
- Capistrano::Configuration::Callbacks
- Capistrano::Configuration::Connections
- Capistrano::Configuration::Execution
- Capistrano::Configuration::Loading
- Capistrano::Configuration::Loading::ClassMethods
- Capistrano::Configuration::LogFormatters
- Capistrano::Configuration::Namespaces
- Capistrano::Configuration::Namespaces::Namespace
- Capistrano::Configuration::Roles
- Capistrano::Configuration::Servers
- Capistrano::Configuration::Variables
- Capistrano::Deploy
- Capistrano::Deploy::Dependencies
- Capistrano::Deploy::LocalDependency
- Capistrano::Deploy::RemoteDependency
- Capistrano::Deploy::SCM
- Capistrano::Deploy::SCM::Accurev
- Capistrano::Deploy::SCM::Accurev::InternalRevision
- Capistrano::Deploy::SCM::Base
- Capistrano::Deploy::SCM::Base::LocalProxy
- Capistrano::Deploy::SCM::Bzr
- Capistrano::Deploy::SCM::Cvs
- Capistrano::Deploy::SCM::Darcs
- Capistrano::Deploy::SCM::Git
- Capistrano::Deploy::SCM::Mercurial
- Capistrano::Deploy::SCM::None
- Capistrano::Deploy::SCM::Perforce
- Capistrano::Deploy::SCM::Subversion
- Capistrano::Deploy::Strategy
- Capistrano::Deploy::Strategy::Base
- Capistrano::Deploy::Strategy::Checkout
- Capistrano::Deploy::Strategy::Copy
- Capistrano::Deploy::Strategy::Export
- Capistrano::Deploy::Strategy::Remote
- Capistrano::Deploy::Strategy::RemoteCache
- Capistrano::Deploy::Strategy::UnsharedRemoteCache
- Capistrano::ProcCallback
- Capistrano::Processable
- Capistrano::Processable::SessionAssociation
- Capistrano::RemoteError
- Capistrano::Role
- Capistrano::Role::DynamicServerList
- Capistrano::SSH
- Capistrano::ServerDefinition
- Capistrano::Shell
- Capistrano::TaskCallback
- Capistrano::TaskDefinition
- Capistrano::Transfer
- Capistrano::Transfer::SFTPTransferWrapper
- Capistrano::Version
- Kernel
- Object
- String

No matching classes.

# 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.