@@ -30,44 +30,44 @@ to be copied to and from a remote server.
30
30
31
31
In a nutshell:
32
32
33
- ```ruby
34
- require 'net/scp'
33
+ ``` ruby
34
+ require ' net/scp'
35
35
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" })
40
40
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 )
44
44
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" })
49
49
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" )
52
52
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"
57
57
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"
60
60
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
66
66
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
+ ```
71
71
72
72
For more information, see Net::SCP.
73
73
@@ -92,16 +92,16 @@ with, it's recommended that you verify the
92
92
you need to add my public key as a trusted certificate (you only need to do
93
93
this once):
94
94
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
+ ```
101
101
102
102
Then- when installing the gem - do so with high security:
103
103
104
- ` $ gem install net-scp -P HighSecurity`
104
+ $ gem install net-scp -P HighSecurity
105
105
106
106
If you don't add the public key, you'll see an error like "Couldn't verify
107
107
data signature". If you're still having trouble let me know and I'll give you
0 commit comments