Module: JschSFTP::SFTP

Defined in:
lib/jsch_sftp/sftp.rb,
lib/jsch_sftp/sftp/entry.rb,
lib/jsch_sftp/sftp/channel.rb,
lib/jsch_sftp/sftp/session.rb

Defined Under Namespace

Classes: Channel, Entry, Session

Class Method Summary collapse

Class Method Details

.start(host, user, options = {}) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/jsch_sftp/sftp.rb', line 6

def self.start(host, user, options = {})
  begin
    session = connect(user, host, options)

    yield session
  rescue Exception => e
    raise e
  ensure
    session.disconnect unless session.nil?
  end
end