# File lib/capistrano/transfer.rb, line 26 def initialize(direction, from, to, sessions, options={}, &block) @direction = direction @from = from @to = to @sessions = sessions @options = options @callback = block @transport = options.fetch(:via, :sftp) @logger = options.delete(:logger) @session_map = {} prepare_transfers end
# File lib/capistrano/transfer.rb, line 70 def active? transfers.any? { |transfer| transfer.active? } end
# File lib/capistrano/transfer.rb, line 74 def operation "#{direction}load" end
# File lib/capistrano/transfer.rb, line 42 def process! loop do begin break unless process_iteration { active? } rescue Exception => error if error.respond_to?(:session) handle_error(error) else raise end end end failed = transfers.select { |txfr| txfr[:failed] } if failed.any? hosts = failed.map { |txfr| txfr[:server] } errors = failed.map { |txfr| "#{txfr[:error]} (#{txfr[:error].message})" }.uniq.join(", ") error = TransferError.new("#{operation} via #{transport} failed on #{hosts.join(',')}: #{errors}") error.hosts = hosts logger.important(error.message) if logger raise error end logger.debug "#{transport} #{operation} complete" if logger self end
Generated with the Darkfish Rdoc Generator 2.