README.rdoc in net-ssh-simple-1.5.9 vs README.rdoc in net-ssh-simple-1.6.0
- old
+ new
@@ -1,9 +1,7 @@
-{<img src="https://gemnasium.com/busyloop/net-ssh-simple.png" alt="Dependency Status" />}[https://gemnasium.com/busyloop/net-ssh-simple]
+= Net::SSH::Simple {<img src="https://gemnasium.com/busyloop/net-ssh-simple.png" alt="Dependency Status" />}[https://gemnasium.com/busyloop/net-ssh-simple]
-= Net::SSH::Simple
-
Net::SSH::Simple is a simple wrapper around Net::SSH and Net::SCP.
It reduces the amount of boilerplate code that you need to write for
handling SSH-connections, thereby preventing many common mistakes related
to error-handling, threading, timeouts and keep-alive.
@@ -37,24 +35,24 @@
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'
+ scp_put 'example2.com', '/tmp/local_foo', '/tmp/remote_bar'
+ scp_get 'example3.com', '/tmp/remote_foo', '/tmp/local_bar'
end
=== Block Syntax (asynchronous)
require 'net/ssh/simple'
t1 = Net::SSH::Simple.async do
- scp_ul 'example1.com', '/tmp/local_foo', '/tmp/remote_bar'
+ scp_put 'example1.com', '/tmp/local_foo', '/tmp/remote_bar'
ssh 'example3.com', 'echo "Hello World A."'
end
t2 = Net::SSH::Simple.async do
- scp_dl 'example6.com', '/tmp/remote_foo', '/tmp/local_bar'
+ scp_get 'example6.com', '/tmp/remote_foo', '/tmp/local_bar'
ssh 'example7.com', 'echo "Hello World B."'
end
r1 = t1.value # wait for t1 to finish and grab return value
r2 = t2.value # wait for t2 to finish and grab return value
@@ -65,12 +63,12 @@
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.scp_put 'example2.com', '/tmp/local_foo', '/tmp/remote_bar'
+ s.scp_get 'example3.com', '/tmp/remote_foo', '/tmp/local_bar'
s.close
== Thread safety
Do _not_ share a Net::SSH::Simple instance across threads.
@@ -102,18 +100,18 @@
# when the same remote host is accessed multiple times.
def do_something_involving_ssh
# The connections to example1-5.com are re-used across
# multiple calls to this method.
ss.ssh 'example1.com', 'echo "Hello World."', {:user => 'not_bob'}
- ss.scp_ul 'example2.com', '/tmp/local_foo', '/tmp/remote_bar'
- ss.scp_dl 'example3.com', '/tmp/remote_foo', '/tmp/local_bar'
+ ss.scp_put 'example2.com', '/tmp/local_foo', '/tmp/remote_bar'
+ ss.scp_get 'example3.com', '/tmp/remote_foo', '/tmp/local_bar'
t = ss.async do
- scp_ul 'example4.com', '/tmp/local_foo', '/tmp/remote_bar'
+ scp_put 'example4.com', '/tmp/local_foo', '/tmp/remote_bar'
end
ss.sync do
- scp_ul 'example5.com', '/tmp/local_foo', '/tmp/remote_bar'
+ scp_put 'example5.com', '/tmp/local_foo', '/tmp/remote_bar'
end
# wait for our async call to finish
t.value