Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make Net::SSH::Connection::Session#sftp accept an argument determinin…
…g whether or not to block while the SFTP subsystem initializes (defaults to true)
  • Loading branch information
jamis committed Apr 26, 2008
1 parent d947cf5 commit 31820b7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.rdoc
@@ -1,5 +1,7 @@
=== *unreleased*

* Make Net::SSH::Connection::Session#sftp accept an argument determining whether or not to block while the SFTP subsystem initializes (defaults to true) [Jamis Buck]

* Allow Session#connect to be useful even in the open/opening states by invoking or queuing the callback block [Jamis Buck]

* Allow custom properties to be set on upload/download initiation via the :properties option [Jamis Buck]
Expand Down
8 changes: 6 additions & 2 deletions lib/net/sftp.rb
Expand Up @@ -50,7 +50,11 @@ class Net::SSH::Connection::Session
# ssh.sftp.upload!("/local/file.tgz", "/remote/file.tgz")
# ssh.exec! "cd /some/path && tar xf /remote/file.tgz && rm /remote/file.tgz"
# end
def sftp
@sftp ||= Net::SFTP::Session.new(self).connect!
def sftp(wait=true)
@sftp ||= begin
sftp = Net::SFTP::Session.new(self)
sftp.connect! if wait
sftp
end
end
end

0 comments on commit 31820b7

Please sign in to comment.