net-scp 3.0.0 → 4.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/.github/pull_request_template.md +1 -0
- data/.github/workflows/changelog.yml +18 -0
- data/.github/workflows/ci.yml +40 -0
- data/.gitignore +8 -0
- data/CHANGES.txt +32 -0
- data/CONTRIBUTING.md +33 -0
- data/Gemfile +9 -2
- data/Manifest +1 -1
- data/README.md +161 -0
- data/Rakefile +116 -12
- data/SECURITY.md +4 -0
- data/changelog.d/README.md +1 -0
- data/gemfiles/legacy.gemfile +7 -0
- data/lib/net/scp/download.rb +49 -14
- data/lib/net/scp/upload.rb +29 -1
- data/lib/net/scp/version.rb +4 -4
- data/lib/net/scp.rb +73 -13
- data/lib/uri/open-scp.rb +14 -2
- data/lib/uri/scp.rb +18 -7
- data/net-scp-public_cert.pem +19 -18
- data/net-scp.gemspec +5 -4
- data/setup.rb +19 -19
- data.tar.gz.sig +0 -0
- metadata +37 -30
- metadata.gz.sig +0 -0
- data/.travis.yml +0 -16
- data/README.rdoc +0 -124
data/README.rdoc
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
= Net::SCP
|
|
2
|
-
|
|
3
|
-
<em><b>Please note: this project is in maintenance mode. It is not under active development but pull requests are very much welcome. Just be sure to include tests! -- delano</b></em>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* Docs: http://net-ssh.github.com/net-scp
|
|
7
|
-
* Issues: https://github.com/net-ssh/net-scp/issues
|
|
8
|
-
* Codes: https://github.com/net-ssh/net-scp
|
|
9
|
-
* Email: net-ssh@solutious.com
|
|
10
|
-
|
|
11
|
-
<em>As of v1.0.5, all gem releases are signed. See INSTALL.</em>
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
== DESCRIPTION:
|
|
15
|
-
|
|
16
|
-
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 be copied to and from a remote server.
|
|
17
|
-
|
|
18
|
-
== FEATURES/PROBLEMS:
|
|
19
|
-
|
|
20
|
-
* Transfer files or entire directory trees to or from a remote host via SCP
|
|
21
|
-
* Can preserve file attributes across transfers
|
|
22
|
-
* Can download files in-memory, or direct-to-disk
|
|
23
|
-
* Support for SCP URI's, and OpenURI
|
|
24
|
-
|
|
25
|
-
== SYNOPSIS:
|
|
26
|
-
|
|
27
|
-
In a nutshell:
|
|
28
|
-
|
|
29
|
-
require 'net/scp'
|
|
30
|
-
|
|
31
|
-
# upload a file to a remote server
|
|
32
|
-
Net::SCP.upload!("remote.host.com", "username",
|
|
33
|
-
"/local/path", "/remote/path",
|
|
34
|
-
:ssh => { :password => "password" })
|
|
35
|
-
|
|
36
|
-
# upload recursively
|
|
37
|
-
Net::SCP.upload!("remote.host", "username", "/path/to/local", "/path/to/remote",
|
|
38
|
-
:ssh => { :password => "foo" }, :recursive => true)
|
|
39
|
-
|
|
40
|
-
# download a file from a remote server
|
|
41
|
-
Net::SCP.download!("remote.host.com", "username",
|
|
42
|
-
"/remote/path", "/local/path",
|
|
43
|
-
:ssh => { :password => "password" })
|
|
44
|
-
|
|
45
|
-
# download a file to an in-memory buffer
|
|
46
|
-
data = Net::SCP::download!("remote.host.com", "username", "/remote/path")
|
|
47
|
-
|
|
48
|
-
# use a persistent connection to transfer files
|
|
49
|
-
Net::SCP.start("remote.host.com", "username", :password => "password") do |scp|
|
|
50
|
-
# upload a file to a remote server
|
|
51
|
-
scp.upload! "/local/path", "/remote/path"
|
|
52
|
-
|
|
53
|
-
# upload from an in-memory buffer
|
|
54
|
-
scp.upload! StringIO.new("some data to upload"), "/remote/path"
|
|
55
|
-
|
|
56
|
-
# run multiple downloads in parallel
|
|
57
|
-
d1 = scp.download("/remote/path", "/local/path")
|
|
58
|
-
d2 = scp.download("/remote/path2", "/local/path2")
|
|
59
|
-
[d1, d2].each { |d| d.wait }
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
# You can also use open-uri to grab data via scp:
|
|
63
|
-
require 'uri/open-scp'
|
|
64
|
-
data = open("scp://user@host/path/to/file.txt").read
|
|
65
|
-
|
|
66
|
-
For more information, see Net::SCP.
|
|
67
|
-
|
|
68
|
-
== REQUIREMENTS:
|
|
69
|
-
|
|
70
|
-
* Net::SSH 2
|
|
71
|
-
|
|
72
|
-
If you wish to run the tests, you'll also need:
|
|
73
|
-
|
|
74
|
-
* Echoe (for Rakefile use)
|
|
75
|
-
* Mocha (for tests)
|
|
76
|
-
|
|
77
|
-
== INSTALL:
|
|
78
|
-
|
|
79
|
-
* gem install net-scp (might need sudo privileges)
|
|
80
|
-
|
|
81
|
-
However, in order to be sure the code you're installing hasn't been tampered with, it's recommended that you verify the signature[http://docs.seattlerb.org/rubygems/Gem/Security.html]. To do this, you need to add my public key as a trusted certificate (you only need to do this once):
|
|
82
|
-
|
|
83
|
-
# Add the public key as a trusted certificate
|
|
84
|
-
# (You only need to do this once)
|
|
85
|
-
$ curl -O https://raw.githubusercontent.com/net-ssh/net-ssh/master/net-ssh-public_cert.pem
|
|
86
|
-
$ gem cert --add net-ssh-public_cert.pem
|
|
87
|
-
|
|
88
|
-
Then- when installing the gem - do so with high security:
|
|
89
|
-
|
|
90
|
-
$ gem install net-scp -P HighSecurity
|
|
91
|
-
|
|
92
|
-
If you don't add the public key, you'll see an error like "Couldn't verify data signature". If you're still having trouble let me know and I'll give you a hand.
|
|
93
|
-
|
|
94
|
-
Or, you can do it the hard way (without Rubygems):
|
|
95
|
-
|
|
96
|
-
* tar xzf net-scp-*.tgz
|
|
97
|
-
* cd net-scp-*
|
|
98
|
-
* ruby setup.rb config
|
|
99
|
-
* ruby setup.rb install (might need sudo privileges)
|
|
100
|
-
|
|
101
|
-
== LICENSE:
|
|
102
|
-
|
|
103
|
-
(The MIT License)
|
|
104
|
-
|
|
105
|
-
Copyright (c) 2008 Jamis Buck <jamis@37signals.com>
|
|
106
|
-
|
|
107
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
|
108
|
-
a copy of this software and associated documentation files (the
|
|
109
|
-
'Software'), to deal in the Software without restriction, including
|
|
110
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
|
111
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
|
112
|
-
permit persons to whom the Software is furnished to do so, subject to
|
|
113
|
-
the following conditions:
|
|
114
|
-
|
|
115
|
-
The above copyright notice and this permission notice shall be
|
|
116
|
-
included in all copies or substantial portions of the Software.
|
|
117
|
-
|
|
118
|
-
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
119
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
120
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
121
|
-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
122
|
-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
123
|
-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
124
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|