Class: Capistrano::Transfer::SFTPTransferWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/capistrano/transfer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(session, &callback) ⇒ SFTPTransferWrapper

Returns a new instance of SFTPTransferWrapper.



141
142
143
144
145
# File 'lib/capistrano/transfer.rb', line 141

def initialize(session, &callback)
  session.sftp(false).connect do |sftp|
    @operation = callback.call(sftp)
  end
end

Instance Attribute Details

#operationObject (readonly)

Returns the value of attribute operation.



139
140
141
# File 'lib/capistrano/transfer.rb', line 139

def operation
  @operation
end

Instance Method Details

#[](key) ⇒ Object



151
152
153
# File 'lib/capistrano/transfer.rb', line 151

def [](key)
  @operation[key]
end

#[]=(key, value) ⇒ Object



155
156
157
# File 'lib/capistrano/transfer.rb', line 155

def []=(key, value)
  @operation[key] = value
end

#abort!Object



159
160
161
# File 'lib/capistrano/transfer.rb', line 159

def abort!
  @operation.abort!
end

#active?Boolean

Returns:

  • (Boolean)


147
148
149
# File 'lib/capistrano/transfer.rb', line 147

def active?
  @operation.nil? || @operation.active?
end