= Net::SSH::Simple Net::SSH::Simple is a simple wrapper around Net::SSH and Net::SCP. == Features * Friendly, flexible API for SSH and SCP (synchronous and asynchronous) * All results are returned as {Net::SSH::Simple::Result}[http://rubydoc.info/gems/net-ssh-simple/Net/SSH/Simple/Result] * All errors are raised as {Net::SSH::Simple::Error}[http://rubydoc.info/gems/net-ssh-simple/Net/SSH/Simple/Error] * Efficient by default; re-uses transport connections where possible * Lots of documentation * {100%}[https://busyloop.net/oss/net-ssh-simple/coverage/] test coverage == Installation gem install net-ssh-simple == Examples === Block Syntax (synchronous) require 'net/ssh/simple' Net::SSH::Simple.sync do r = ssh 'example1.com', 'echo "Hello World."' puts r.stdout #=> "Hello World." scp_ul 'example2.com', '/tmp/local_foo', '/tmp/remote_bar' scp_dl 'example3.com', '/tmp/remote_foo', '/tmp/local_bar' end === Block Syntax (asynchronous) require 'net/ssh/simple' a = Net::SSH::Simple.async do ssh 'example1.com', 'echo "Hello World."' scp_ul 'example2.com', '/tmp/local_foo', '/tmp/remote_bar' scp_dl 'example3.com', '/tmp/remote_foo', '/tmp/local_bar' end b = Net::SSH::Simple.async do ssh 'example4.com', 'echo "Hello World."' scp_ul 'example5.com', '/tmp/local_foo', '/tmp/remote_bar' scp_dl 'example6.com', '/tmp/remote_foo', '/tmp/local_bar' end a.value # Wait for thread A to finish and capture result b.value # Wait for thread B to finish and capture result === Using an instance require 'net/ssh/simple' s = Net::SSH::Simple.new s.ssh 'example1.com', 'echo "Hello World."' s.scp_ul 'example2.com', '/tmp/local_foo', '/tmp/remote_bar' s.scp_dl 'example3.com', '/tmp/remote_foo', '/tmp/local_bar' s.close == Documentation See {Net::SSH::Simple}[http://rubydoc.info/gems/net-ssh-simple/Net/SSH/Simple] for more examples and full API. == License (MIT) Copyright (C) 2011 by moe@busyloop.net Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.