@@ -30,44 +30,44 @@ to be copied to and from a remote server.
3030
3131In a nutshell:
3232
33- ```ruby
34- require 'net/scp'
33+ ``` ruby
34+ require ' net/scp'
3535
36- # upload a file to a remote server
37- Net::SCP.upload!("remote.host.com", "username",
38- "/local/path", "/remote/path",
39- :ssh => { :password => "password" })
36+ # upload a file to a remote server
37+ Net ::SCP .upload!(" remote.host.com" , " username" ,
38+ " /local/path" , " /remote/path" ,
39+ :ssh => { :password => " password" })
4040
41- # upload recursively
42- Net::SCP.upload!("remote.host", "username", "/path/to/local", "/path/to/remote",
43- :ssh => { :password => "foo" }, :recursive => true)
41+ # upload recursively
42+ Net ::SCP .upload!(" remote.host" , " username" , " /path/to/local" , " /path/to/remote" ,
43+ :ssh => { :password => " foo" }, :recursive => true )
4444
45- # download a file from a remote server
46- Net::SCP.download!("remote.host.com", "username",
47- "/remote/path", "/local/path",
48- :ssh => { :password => "password" })
45+ # download a file from a remote server
46+ Net ::SCP .download!(" remote.host.com" , " username" ,
47+ " /remote/path" , " /local/path" ,
48+ :ssh => { :password => " password" })
4949
50- # download a file to an in-memory buffer
51- data = Net::SCP::download!("remote.host.com", "username", "/remote/path")
50+ # download a file to an in-memory buffer
51+ data = Net ::SCP ::download!(" remote.host.com" , " username" , " /remote/path" )
5252
53- # use a persistent connection to transfer files
54- Net::SCP.start("remote.host.com", "username", :password => "password") do |scp|
55- # upload a file to a remote server
56- scp.upload! "/local/path", "/remote/path"
53+ # use a persistent connection to transfer files
54+ Net ::SCP .start(" remote.host.com" , " username" , :password => " password" ) do |scp |
55+ # upload a file to a remote server
56+ scp.upload! " /local/path" , " /remote/path"
5757
58- # upload from an in-memory buffer
59- scp.upload! StringIO.new("some data to upload"), "/remote/path"
58+ # upload from an in-memory buffer
59+ scp.upload! StringIO .new (" some data to upload" ), " /remote/path"
6060
61- # run multiple downloads in parallel
62- d1 = scp.download("/remote/path", "/local/path")
63- d2 = scp.download("/remote/path2", "/local/path2")
64- [d1, d2].each { |d| d.wait }
65- end
61+ # run multiple downloads in parallel
62+ d1 = scp.download(" /remote/path" , " /local/path" )
63+ d2 = scp.download(" /remote/path2" , " /local/path2" )
64+ [d1, d2].each { |d | d.wait }
65+ end
6666
67- # You can also use open-uri to grab data via scp:
68- require 'uri/open-scp'
69- data = open("scp://user@host/path/to/file.txt").read
70- ```
67+ # You can also use open-uri to grab data via scp:
68+ require ' uri/open-scp'
69+ data = open (" scp://user@host/path/to/file.txt" ).read
70+ ```
7171
7272For more information, see Net::SCP.
7373
@@ -92,16 +92,16 @@ with, it's recommended that you verify the
9292you need to add my public key as a trusted certificate (you only need to do
9393this once):
9494
95- ```sh
96- # Add the public key as a trusted certificate
97- # (You only need to do this once)
98- $ curl -O https://raw.githubusercontent.com/net-ssh/net-ssh/master/net-ssh-public_cert.pem
99- $ gem cert --add net-ssh-public_cert.pem
100- ```
95+ ``` sh
96+ # Add the public key as a trusted certificate
97+ # (You only need to do this once)
98+ $ curl -O https://raw.githubusercontent.com/net-ssh/net-ssh/master/net-ssh-public_cert.pem
99+ $ gem cert --add net-ssh-public_cert.pem
100+ ```
101101
102102Then- when installing the gem - do so with high security:
103103
104- ` $ gem install net-scp -P HighSecurity`
104+ $ gem install net-scp -P HighSecurity
105105
106106If you don't add the public key, you'll see an error like "Couldn't verify
107107data signature". If you're still having trouble let me know and I'll give you
0 commit comments