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.


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

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


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

def operation
  @operation
end

Instance Method Details

#[](key) ⇒ Object


164
165
166
# File 'lib/capistrano/transfer.rb', line 164

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

#[]=(key, value) ⇒ Object


168
169
170
# File 'lib/capistrano/transfer.rb', line 168

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

#abort!Object


172
173
174
# File 'lib/capistrano/transfer.rb', line 172

def abort!
  @operation.abort!
end

#active?Boolean

Returns:

  • (Boolean)

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

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