# File lib/net/sftp.rb, line 30 def self.start(host, user, options={}, &block) session = Net::SSH.start(host, user, options) sftp = Net::SFTP::Session.new(session, &block).connect! if block_given? sftp.loop session.close return nil end sftp rescue Object => anything begin session.shutdown! rescue ::Exception # swallow exceptions that occur while trying to shutdown end raise anything end