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

Module | Capistrano::Configuration::Actions::FileTransfer
In: | lib/capistrano/configuration/actions/file_transfer.rb lib/capistrano/configuration/actions/file_transfer.rb

### Methods

download download get get put put transfer transfer upload upload

### Public Instance methods

download(from, to, options={}, &block)

[Source]

        # 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

download(from, to, options={}, &block)

[Source]

        # 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(remote_path, path, options={}, &block)

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"

[Source]

        # 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

get(remote_path, path, options={}, &block)

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"

[Source]

        # 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

put(data, path, options={})

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.

[Source]

        # 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

put(data, path, options={})

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.

[Source]

        # 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

transfer(direction, from, to, options={}, &block)

[Source]

        # File lib/capistrano/configuration/actions/file_transfer.rb, line 37
    37:         def transfer(direction, from, to, options={}, &block)
    38:           execute_on_servers(options) do |servers|
    39:             targets = servers.map { |s| sessions[s] }
    40:             Transfer.process(direction, from, to, targets, options.merge(:logger => logger), &block)
    41:           end
    42:         end

transfer(direction, from, to, options={}, &block)

[Source]

        # File lib/capistrano/configuration/actions/file_transfer.rb, line 37
    37:         def transfer(direction, from, to, options={}, &block)
    38:           execute_on_servers(options) do |servers|
    39:             targets = servers.map { |s| sessions[s] }
    40:             Transfer.process(direction, from, to, targets, options.merge(:logger => logger), &block)
    41:           end
    42:         end

upload(from, to, options={}, &block)

[Source]

        # 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}"
    30:           end
    31:         end

upload(from, to, options={}, &block)

[Source]

        # 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}"
    30:           end
    31:         end

[Validate]