0.01
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Thread-safe Open3 for Net::SSH
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 2.6
 Project Readme

net-ssh-open3

Gem Version

Thread-safe Open3 for Net::SSH.

Adds some Open3-style functions to Net::SSH::Connection::Session.

See ruby 1.9.3 doc or ruby 2.0 doc.

Usage example:

irb(main):001:0> require 'net-ssh-open3'
=> true
irb(main):002:0> session = Net::SSH.start('localhost', 'root'); nil
=> nil
irb(main):003:0> puts session.capture2e('ls', '/boot') # also: 'ls /boot'
grub
initramfs-linux-fallback.img
initramfs-linux.img
lost+found
memtest86+
vmlinuz-linux
pid 1594 exit 0
=> nil
irb(main):004:0> session.popen2e('sh') { |i, oe, w| i.puts('kill $$'); w[:status] }
=> #<Net::SSH::Process::Status: pid 16864 TERM (signal 15) core false>

Note: a single SSH session may have several channels, i.e. you may run several Open3 methods on the same session in parallel (in different threads).

For more information please see documentation inside. Recommended starting point is "Methods included from Net::SSH::Open3" in Net::SSH::Connection::Session.

TODO: don't require block