0
+* http://net-ssh.rubyforge.org/scp
0
+Net::SCP is a pure-Ruby implementation of the SCP protocol. This operates over SSH (and requires the Net::SSH library), and allows files and directory trees to copied to and from a remote server.
0
+* Transfer files or entire directory trees to or from a remote host via SCP
0
+* Can preserve file attributes across transfers
0
+* Can download files in-memory, or direct-to-disk
0
+* Support for SCP URI's, and OpenURI
0
+ # upload a file to a remote server
0
+ Net::SCP.upload!("remote.host.com", "username",
0
+ "/local/path", "/remote/path",
0
+ :password => "password")
0
+ # download a file from a remote server
0
+ Net::SCP.download!("remote.host.com", "username",
0
+ "/remote/path", "/local/path",
0
+ :password => password)
0
+ # download a file to an in-memory buffer
0
+ data = Net::SCP::download!("remote.host.com", "username", "/remote/path")
0
+ # use a persistent connection to transfer files
0
+ Net::SCP.start("remote.host.com", "username", :password => "password") do |scp|
0
+ # upload a file to a remote server
0
+ scp.upload! "/local/path", "/remote/path"
0
+ # upload from an in-memory buffer
0
+ scp.upload! StringIO.new("some data to upload"), "/remote/path"
0
+ # run multiple downloads in parallel
0
+ d1 = scp.download("/remote/path", "/local/path")
0
+ d2 = scp.download("/remote/path2", "/local/path2")
0
+ [d1, d2].each { |d| d.wait }
0
+ # You can also use open-uri to grab data via scp:
0
+ require 'uri/open-scp'
0
+ data = open("scp://user@host/path/to/file.txt").read
0
+For more information, see Net::SCP.
0
+If you wish to run the tests, you'll also need:
0
+* Echoe (for Rakefile use)
0
+* gem install net-scp (might need sudo privileges)
0
+Or, you can do it the hard way (without Rubygems):
0
+* tar xzf net-scp-*.tgz
0
+* ruby setup.rb install (might need sudo privileges)
0
+Copyright (c) 2008 Jamis Buck <jamis@37signals.com>
0
+Permission is hereby granted, free of charge, to any person obtaining
0
+a copy of this software and associated documentation files (the
0
+'Software'), to deal in the Software without restriction, including
0
+without limitation the rights to use, copy, modify, merge, publish,
0
+distribute, sublicense, and/or sell copies of the Software, and to
0
+permit persons to whom the Software is furnished to do so, subject to
0
+the following conditions:
0
+The above copyright notice and this permission notice shall be
0
+included in all copies or substantial portions of the Software.
0
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
0
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
0
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
0
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
0
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
0
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
0
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Comments
No one has commented yet.