>
>You can use the "Net::SSH::Service::Process.popen3" method to
start a
>synchronous "session" over a given connection. Something like
this:
>
>Net::SSH.start( host, login, password ) do |session|
>input, output, error >Net::SSH::Service::Process.popen3( session,
"sh" )
>
>input.puts "cd /var"
>input.puts "pwd"
>result = output.read
>input.puts "exit"
>
>assert_equal "/var", result
>end
>
>It''s not as visually pleasing as Telnet#cmd, but it should work for
now.
>The problem is that the SSH protocol is much more complicated than
>Telnet, running multiple channels in parallel. However, given the popen3
>functionality, it should be possible to further abstract that away to
>get something closer to the Telnet#cmd interface.
>
>Hope that helps,
Yes, this helps a lot. I''ll try do implement cmd abstarction on the
top
of the popen3.
If its good enough, I''ll send a patch. Thanks for help!