net-ssh/net-ssh — pull request #64 by mhuffnagle (2012-10-29 20:16:47+00:00)
Title: Net::SSH.start now returns result of block

It's useful (and expected) to have the result of evaluating a block returned. Net::HTTP.start has this behavior, for example. Updated Net::SSH to have the same behavior.

Before, you would get this:

1.9.3-p286 :001 > require 'net/ssh'
=> true
1.9.3-p286 :002 > Net::SSH.start('somehost', 'someuser') { |ssh| ssh.exec! 'hostname' }
=> nil

Now you'll get:

1.9.3-p286 :001 > require 'net/ssh'
=> true
1.9.3-p286 :002 > Net::SSH.start('somehost', 'someuser') { |ssh| ssh.exec! 'hostname' }
=> "somehost\n"