net-scp 4.0.0 → 4.0.1.rc3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c3baa90ed09a647a9de37e1c84c10110a292ba119511ff09aec25038f7f76049
4
- data.tar.gz: e648a121a644da52f1fbca825acf905d2258e9ef0a768adffd34d22a64e6f72c
3
+ metadata.gz: 85938ca32f11557ce4671954e90804b552ff17c08f70b048e6dacf3f1fa19e14
4
+ data.tar.gz: c868ed5839f461ccde85599b8b8eb359f4a33206f671dd15a6ab935fa8dc2f5b
5
5
  SHA512:
6
- metadata.gz: c0b4c797310b5a423a536ead11851bc36e2d59e3bd6d2d9977de7ecc5fa660170d0513c5a815d3d5bcaac35d724b2103d3f299ab10f2110a9661b6fe11600e9f
7
- data.tar.gz: c96cf90d037fc20c070ccc7112b574c3da8b9ef5081788054459a58a13ed8a70e9412ab6ab1c94d19fd5b65deb568e205e978d04fdb7df0636f1886e42dd48f3
6
+ metadata.gz: fc18c52990e428fb8f4dc2132d016d8817b5e47a916462f72bc4d4fe6092909abda1ba5b99c0a49cc370913c8fe7e77dc0823f322cad5ded384865b16a479749
7
+ data.tar.gz: fdef41a58bd49186406b01e4d5829c263c599a704a30023711314ecac03fa6b5112f381777941a24602074de94a532b7f6f03a120c026b59f93da95d444aa6d5
checksums.yaml.gz.sig CHANGED
Binary file
@@ -0,0 +1,23 @@
1
+ name: CI
2
+ on:
3
+ pull_request:
4
+ push: { branches: master }
5
+ permissions:
6
+ contents: read
7
+ jobs:
8
+ test:
9
+ runs-on: ubuntu-latest
10
+ strategy:
11
+ fail-fast: false
12
+ matrix:
13
+ ruby-version: ['2.3', '2.4', '2.5', '2.6', '2.7', '3.0', '3.1', '3.2', '3.3', 'ruby-head']
14
+ continue-on-error: ${{ matrix.ruby-version == 'ruby-head' }}
15
+ steps:
16
+ - uses: actions/checkout@v3
17
+ - name: Set up Ruby ${{ matrix.ruby-version }}
18
+ uses: ruby/setup-ruby@v1
19
+ with:
20
+ ruby-version: ${{ matrix.ruby-version }}
21
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
22
+ - name: Run Tests
23
+ run: bundle exec rake test
data/.gitignore CHANGED
@@ -4,3 +4,10 @@ doc
4
4
  *.swp
5
5
 
6
6
  .DS_Store
7
+
8
+ # Bundle local files
9
+ /vendor/
10
+ .bundle/config
11
+ Gemfile.lock
12
+
13
+ lib/net/ssh/version.rb.old
data/Gemfile CHANGED
@@ -4,8 +4,8 @@ source 'https://rubygems.org'
4
4
  gemspec
5
5
 
6
6
  # TODO: add to gemspec
7
- gem "bundler", "~> 1.11"
8
- gem "rake", "~> 12.0"
7
+ gem "bundler", ">= 1.11"
8
+ gem "rake", ">= 12.0"
9
9
 
10
10
  gem 'byebug', group: %i[development test] if !Gem.win_platform? && RUBY_ENGINE == "ruby"
11
11
 
data/Manifest CHANGED
@@ -7,7 +7,7 @@ lib/net/scp.rb
7
7
  lib/uri/open-scp.rb
8
8
  lib/uri/scp.rb
9
9
  Rakefile
10
- README.rdoc
10
+ README.md
11
11
  setup.rb
12
12
  test/common.rb
13
13
  test/test_all.rb
data/README.md ADDED
@@ -0,0 +1,143 @@
1
+ # Net::SCP
2
+
3
+ ***Please note: this project is in maintenance mode. It is not under active
4
+ development but pull requests are very much welcome. Just be sure to include
5
+ tests! -- delano***
6
+
7
+ * Docs: http://net-ssh.github.io/net-scp
8
+ * Issues: https://github.com/net-ssh/net-scp/issues
9
+ * Codes: https://github.com/net-ssh/net-scp
10
+ * Email: net-ssh@solutious.com
11
+
12
+
13
+ *As of v1.0.5, all gem releases are signed. See INSTALL.*
14
+
15
+ ## DESCRIPTION:
16
+
17
+ Net::SCP is a pure-Ruby implementation of the SCP protocol. This operates over
18
+ SSH (and requires the Net::SSH library), and allows files and directory trees
19
+ to be copied to and from a remote server.
20
+
21
+ ## FEATURES/PROBLEMS:
22
+
23
+ * Transfer files or entire directory trees to or from a remote host via SCP
24
+ * Can preserve file attributes across transfers
25
+ * Can download files in-memory, or direct-to-disk
26
+ * Support for SCP URI's, and OpenURI
27
+
28
+
29
+ ## SYNOPSIS:
30
+
31
+ In a nutshell:
32
+
33
+ ```ruby
34
+ require 'net/scp'
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" })
40
+
41
+ # upload recursively
42
+ Net::SCP.upload!("remote.host", "username", "/path/to/local", "/path/to/remote",
43
+ :ssh => { :password => "foo" }, :recursive => true)
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" })
49
+
50
+ # download a file to an in-memory buffer
51
+ data = Net::SCP::download!("remote.host.com", "username", "/remote/path")
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"
57
+
58
+ # upload from an in-memory buffer
59
+ scp.upload! StringIO.new("some data to upload"), "/remote/path"
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
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
+ ```
71
+
72
+ For more information, see Net::SCP.
73
+
74
+ ## REQUIREMENTS:
75
+
76
+ * Net::SSH 2
77
+
78
+ If you wish to run the tests, you'll also need:
79
+
80
+ * Echoe (for Rakefile use)
81
+ * Mocha (for tests)
82
+
83
+
84
+ ## INSTALL:
85
+
86
+ * ```gem install net-scp (might need sudo privileges)```
87
+
88
+
89
+ However, in order to be sure the code you're installing hasn't been tampered
90
+ with, it's recommended that you verify the
91
+ [signature](http://docs.seattlerb.org/rubygems/Gem/Security.html). To do this,
92
+ you need to add my public key as a trusted certificate (you only need to do
93
+ this once):
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
+ ```
101
+
102
+ Then- when installing the gem - do so with high security:
103
+
104
+ $ gem install net-scp -P HighSecurity
105
+
106
+ If you don't add the public key, you'll see an error like "Couldn't verify
107
+ data signature". If you're still having trouble let me know and I'll give you
108
+ a hand.
109
+
110
+ Or, you can do it the hard way (without Rubygems):
111
+
112
+ * tar xzf net-scp-*.tgz
113
+ * cd net-scp-*
114
+ * ruby setup.rb config
115
+ * ruby setup.rb install (might need sudo privileges)
116
+
117
+ ## Security contact information
118
+
119
+ See [SECURITY.md](SECURITY.md)
120
+
121
+ ## LICENSE:
122
+
123
+ (The MIT License)
124
+
125
+ Copyright (c) 2008 Jamis Buck <jamis@37signals.com>
126
+
127
+ Permission is hereby granted, free of charge, to any person obtaining a copy
128
+ of this software and associated documentation files (the 'Software'), to deal
129
+ in the Software without restriction, including without limitation the rights
130
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
131
+ copies of the Software, and to permit persons to whom the Software is
132
+ furnished to do so, subject to the following conditions:
133
+
134
+ The above copyright notice and this permission notice shall be included in all
135
+ copies or substantial portions of the Software.
136
+
137
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
138
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
139
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
140
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
141
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
142
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
143
+ SOFTWARE.
data/Rakefile CHANGED
@@ -71,11 +71,98 @@ RDoc::Task.new do |rdoc|
71
71
  rdoc.rdoc_dir = "rdoc"
72
72
  rdoc.title = "#{name} #{version}"
73
73
  rdoc.generator = 'hanna' # gem install hanna-nouveau
74
- rdoc.main = 'README.rdoc'
74
+ rdoc.main = 'README.md'
75
75
  rdoc.rdoc_files.include("README*")
76
76
  rdoc.rdoc_files.include("bin/*.rb")
77
77
  rdoc.rdoc_files.include("lib/**/*.rb")
78
78
  extra_files.each { |file|
79
- rdoc.rdoc_files.include(file) if File.exists?(file)
79
+ rdoc.rdoc_files.include(file) if File.exist?(file)
80
80
  }
81
81
  end
82
+
83
+ def change_version(&block)
84
+ version_file = 'lib/net/scp/version.rb'
85
+ require_relative version_file
86
+ pre = Net::SCP::Version::PRE
87
+ tiny = Net::SCP::Version::TINY
88
+ result = block[pre: pre, tiny: Net::SCP::Version::TINY]
89
+ raise ArgumentError, "Version change logic should always return a pre" unless result.key?(:pre)
90
+
91
+ new_pre = result[:pre]
92
+ new_tiny = result[:tiny] || tiny
93
+ found = { pre: false, tiny: false }
94
+ File.open("#{version_file}.new", "w") do |f|
95
+ File.readlines(version_file).each do |line|
96
+ match =
97
+ if pre.nil?
98
+ /^(\s+PRE\s+=\s+)nil(\s*)$/.match(line)
99
+ else
100
+ /^(\s+PRE\s+=\s+")#{pre}("\s*)$/.match(line)
101
+ end
102
+ if match
103
+ prefix = match[1]
104
+ postfix = match[2]
105
+ prefix.delete_suffix!('"')
106
+ postfix.delete_prefix!('"')
107
+ new_line = "#{prefix}#{new_pre.inspect}#{postfix}"
108
+ puts "Changing:\n - #{line} + #{new_line}"
109
+ line = new_line
110
+ found[:pre] = true
111
+ end
112
+
113
+ if new_tiny != tiny
114
+ match = /^(\s+TINY\s+=\s+)#{tiny}(\s*)$/.match(line)
115
+ if match
116
+ prefix = match[1]
117
+ postfix = match[2]
118
+ new_line = "#{prefix}#{new_tiny}#{postfix}"
119
+ puts "Changing:\n - #{line} + #{new_line}"
120
+ line = new_line
121
+ found[:tiny] = true
122
+ end
123
+ end
124
+
125
+ f.write(line)
126
+ end
127
+ raise ArgumentError, "Cound not find line: PRE = \"#{pre}\" in #{version_file}" unless found[:pre]
128
+ raise ArgumentError, "Cound not find line: TINY = \"#{tiny}\" in #{version_file}" unless found[:tiny] || new_tiny == tiny
129
+ end
130
+
131
+ FileUtils.mv version_file, "#{version_file}.old"
132
+ FileUtils.mv "#{version_file}.new", version_file
133
+ end
134
+
135
+ namespace :vbump do
136
+ desc "Final release"
137
+ task :final do
138
+ change_version do |pre:, tiny:|
139
+ _ = tiny
140
+ if pre.nil?
141
+ { tiny: tiny + 1, pre: nil }
142
+ else
143
+ raise ArgumentError, "Unexpected pre: #{pre}" if pre.nil?
144
+
145
+ { pre: nil }
146
+ end
147
+ end
148
+ end
149
+
150
+ desc "Increment prerelease"
151
+ task :pre, [:type] do |_t, args|
152
+ change_version do |pre:, tiny:|
153
+ puts " PRE => #{pre.inspect}"
154
+ match = /^([a-z]+)(\d+)/.match(pre)
155
+ raise ArgumentError, "Unexpected pre: #{pre}" if match.nil? && args[:type].nil?
156
+
157
+ if match.nil? || (!args[:type].nil? && args[:type] != match[1])
158
+ if pre.nil?
159
+ { pre: "#{args[:type]}1", tiny: tiny + 1 }
160
+ else
161
+ { pre: "#{args[:type]}1" }
162
+ end
163
+ else
164
+ { pre: "#{match[1]}#{match[2].to_i + 1}" }
165
+ end
166
+ end
167
+ end
168
+ end
data/SECURITY.md ADDED
@@ -0,0 +1,4 @@
1
+ ## Security contact information
2
+
3
+ To report a security vulnerability, please use the
4
+ [GitHub vulnerability reporting feature](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability).
@@ -1,5 +1,5 @@
1
1
  module Net
2
- module SCP
2
+ class SCP
3
3
  # A class for describing the current version of a library. The version
4
4
  # consists of three parts: the +major+ number, the +minor+ number, and the
5
5
  # +tiny+ (or +patch+) number.
@@ -52,11 +52,11 @@ module Net
52
52
  MINOR = 0
53
53
 
54
54
  # The tiny component of this version of the Net::SSH library
55
- TINY = 0
55
+ TINY = 1
56
56
 
57
57
  # The prerelease component of this version of the Net::SSH library
58
58
  # nil allowed
59
- PRE = nil
59
+ PRE = "rc3"
60
60
 
61
61
  # The current version of the Net::SSH library as a Version instance
62
62
  CURRENT = new(*[MAJOR, MINOR, TINY, PRE].compact)
@@ -0,0 +1,68 @@
1
+ module Net
2
+ class SCP
3
+ # A class for describing the current version of a library. The version
4
+ # consists of three parts: the +major+ number, the +minor+ number, and the
5
+ # +tiny+ (or +patch+) number.
6
+ #
7
+ # Two Version instances may be compared, so that you can test that a version
8
+ # of a library is what you require:
9
+ #
10
+ # require 'net/scp/version'
11
+ #
12
+ # if Net::SCP::Version::CURRENT < Net::SCP::Version[2,1,0]
13
+ # abort "your software is too old!"
14
+ # end
15
+ class Version
16
+ include Comparable
17
+
18
+ # A convenience method for instantiating a new Version instance with the
19
+ # given +major+, +minor+, and +tiny+ components.
20
+ def self.[](major, minor, tiny, pre = nil)
21
+ new(major, minor, tiny, pre)
22
+ end
23
+
24
+ attr_reader :major, :minor, :tiny
25
+
26
+ # Create a new Version object with the given components.
27
+ def initialize(major, minor, tiny, pre = nil)
28
+ @major, @minor, @tiny, @pre = major, minor, tiny, pre
29
+ end
30
+
31
+ # Compare this version to the given +version+ object.
32
+ def <=>(version)
33
+ to_i <=> version.to_i
34
+ end
35
+
36
+ # Converts this version object to a string, where each of the three
37
+ # version components are joined by the '.' character. E.g., 2.0.0.
38
+ def to_s
39
+ @to_s ||= [@major, @minor, @tiny, @pre].compact.join(".")
40
+ end
41
+
42
+ # Converts this version to a canonical integer that may be compared
43
+ # against other version objects.
44
+ def to_i
45
+ @to_i ||= @major * 1_000_000 + @minor * 1_000 + @tiny
46
+ end
47
+
48
+ # The major component of this version of the Net::SSH library
49
+ MAJOR = 4
50
+
51
+ # The minor component of this version of the Net::SSH library
52
+ MINOR = 0
53
+
54
+ # The tiny component of this version of the Net::SSH library
55
+ TINY = 1
56
+
57
+ # The prerelease component of this version of the Net::SSH library
58
+ # nil allowed
59
+ PRE = "rc2"
60
+
61
+ # The current version of the Net::SSH library as a Version instance
62
+ CURRENT = new(*[MAJOR, MINOR, TINY, PRE].compact)
63
+
64
+ # The current version of the Net::SSH library as a String
65
+ STRING = CURRENT.to_s
66
+ end
67
+ end
68
+ end
data/lib/net/scp.rb CHANGED
@@ -362,7 +362,21 @@ module Net
362
362
  channel[:stack ] = []
363
363
  channel[:error_string] = ''
364
364
 
365
- channel.on_close { |ch2| send("#{channel[:state]}_state", channel); raise Net::SCP::Error, "SCP did not finish successfully (#{channel[:exit]}): #{channel[:error_string]}" if channel[:exit] != 0 }
365
+ channel.on_close do
366
+ # If we got an exit-status and it is not 0, something went wrong
367
+ if !channel[:exit].nil? && channel[:exit] != 0
368
+ raise Net::SCP::Error, 'SCP did not finish successfully ' \
369
+ "(#{channel[:exit]}): #{channel[:error_string]}"
370
+ end
371
+ # We may get no exit-status at all as returning a status is only RECOMENDED
372
+ # in RFC4254. But if our state is not :finish, something went wrong
373
+ if channel[:exit].nil? && channel[:state] != :finish
374
+ raise Net::SCP::Error, 'SCP did not finish successfully ' \
375
+ '(channel closed before end of transmission)'
376
+ end
377
+ # At this point, :state can be :finish or :next_item
378
+ send("#{channel[:state]}_state", channel)
379
+ end
366
380
  channel.on_data { |ch2, data| channel[:buffer].append(data) }
367
381
  channel.on_extended_data { |ch2, type, data| debug { data.chomp } }
368
382
  channel.on_request("exit-status") { |ch2, data| channel[:exit] = data.read_long }
data/lib/uri/scp.rb CHANGED
@@ -8,7 +8,7 @@ module URI
8
8
  :scheme,
9
9
  :userinfo,
10
10
  :host, :port, :path,
11
- :query
11
+ :query
12
12
  ].freeze
13
13
 
14
14
  attr_reader :options
@@ -31,5 +31,9 @@ module URI
31
31
  end
32
32
  end
33
33
 
34
- @@schemes['SCP'] = SCP
35
- end
34
+ if respond_to? :register_scheme
35
+ register_scheme "SCP", SCP
36
+ else
37
+ @@schemes["SCP"] = SCP
38
+ end
39
+ end
@@ -1,20 +1,21 @@
1
1
  -----BEGIN CERTIFICATE-----
2
- MIIDQDCCAiigAwIBAgIBATANBgkqhkiG9w0BAQsFADAlMSMwIQYDVQQDDBpuZXRz
3
- c2gvREM9c29sdXRpb3VzL0RDPWNvbTAeFw0yMjA3MjUxODEzNTJaFw0yMzA3MjUx
4
- ODEzNTJaMCUxIzAhBgNVBAMMGm5ldHNzaC9EQz1zb2x1dGlvdXMvREM9Y29tMIIB
5
- IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxieE22fR/qmdPKUHyYTyUx2g
6
- wskLwrCkxay+Tvc97ZZUOwf85LDDDPqhQaTWLvRwnIOMgQE2nBPzwalVclK6a+pW
7
- x/18KDeZY15vm3Qn5p42b0wi9hUxOqPm3J2hdCLCcgtENgdX21nVzejn39WVqFJO
8
- lntgSDNW5+kCS8QaRsmIbzj17GKKkrsw39kiQw7FhWfJFeTjddzoZiWwc59KA/Bx
9
- fBbmDnsMLAtAtauMOxORrbx3EOY7sHku/kSrMg3FXFay7jc6BkbbUij+MjJ/k82l
10
- 4o8o0YO4BAnya90xgEmgOG0LCCxRhuXQFnMDuDjK2XnUe0h4/6NCn94C+z9GsQID
11
- AQABo3sweTAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQUBfKiwO2e
12
- M4NEiRrVG793qEPLYyMwHwYDVR0RBBgwFoEUbmV0c3NoQHNvbHV0aW91cy5jb20w
13
- HwYDVR0SBBgwFoEUbmV0c3NoQHNvbHV0aW91cy5jb20wDQYJKoZIhvcNAQELBQAD
14
- ggEBADxmDQVPrCXVbQqdaRJvoEdD/4LDWqSq6huG4n4PvhNmi9sKRVNh4eJNwFx+
15
- VBX5PGeha0OL9tr5dlMLV7aCgty+3BTIg+Li8Ifc+TOUi+8nIHs6U4SZ4vFNs/bt
16
- WUe6k027p0PHXPl63c5qQX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Rp
14
+ b3VzLmNvbTAfBgNVHRIEGDAWgRRuZXRzc2hAc29sdXRpb3VzLmNvbTANBgkqhkiG
15
+ 9w0BAQsFAAOCAQEAOEVGPubOS9dBQmiJYIZHOXe2Q50iQgxKa7hyEJcyA7q69Q5h
16
+ Ha5r4WpZyW0Dkr0+jIkT8GS7hO0XnUZdOiuNFQrx30jfRSVT7680dF6wAHEQZJqC
17
+ ZmYFthhR/mtzi7bA+Ubd0PyBNivqt3WhWP+Z19j1bVWIwzczUcFFao+FBjXptI0m
18
+ VGRPnRIzATA2qQUuKGkwrNFSHD9tDIHXSvwJ62U9ahoMKfMoDP0WHdPIpFCB8bPg
19
+ wxMvGTA/RH93o6dL09sq7rVtsS9NNFmBGJWLZWWPfcspNBUXS0HTWXsWS9XTm2bm
20
+ bbXS+I4xE1yFIPs39ej57LGJDMgMhWTyJF2zVg==
20
21
  -----END CERTIFICATE-----
data/net-scp.gemspec CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
23
23
 
24
24
  spec.extra_rdoc_files = [
25
25
  "LICENSE.txt",
26
- "README.rdoc"
26
+ "README.md"
27
27
  ]
28
28
 
29
29
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: net-scp
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.0.1.rc3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jamis Buck
@@ -12,26 +12,27 @@ bindir: bin
12
12
  cert_chain:
13
13
  - |
14
14
  -----BEGIN CERTIFICATE-----
15
- MIIDQDCCAiigAwIBAgIBATANBgkqhkiG9w0BAQsFADAlMSMwIQYDVQQDDBpuZXRz
16
- c2gvREM9c29sdXRpb3VzL0RDPWNvbTAeFw0yMjA3MjUxODEzNTJaFw0yMzA3MjUx
17
- ODEzNTJaMCUxIz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qt3WhWP+Z19j1bVWIwzczUcFFao+FBjXptI0m
31
+ VGRPnRIzATA2qQUuKGkwrNFSHD9tDIHXSvwJ62U9ahoMKfMoDP0WHdPIpFCB8bPg
32
+ wxMvGTA/RH93o6dL09sq7rVtsS9NNFmBGJWLZWWPfcspNBUXS0HTWXsWS9XTm2bm
33
+ bbXS+I4xE1yFIPs39ej57LGJDMgMhWTyJF2zVg==
33
34
  -----END CERTIFICATE-----
34
- date: 2022-10-18 00:00:00.000000000 Z
35
+ date: 2024-12-25 00:00:00.000000000 Z
35
36
  dependencies:
36
37
  - !ruby/object:Gem::Dependency
37
38
  name: net-ssh
@@ -88,21 +89,23 @@ executables: []
88
89
  extensions: []
89
90
  extra_rdoc_files:
90
91
  - LICENSE.txt
91
- - README.rdoc
92
+ - README.md
92
93
  files:
94
+ - ".github/workflows/ci.yml"
93
95
  - ".gitignore"
94
- - ".travis.yml"
95
96
  - CHANGES.txt
96
97
  - Gemfile
97
98
  - LICENSE.txt
98
99
  - Manifest
99
- - README.rdoc
100
+ - README.md
100
101
  - Rakefile
102
+ - SECURITY.md
101
103
  - lib/net/scp.rb
102
104
  - lib/net/scp/download.rb
103
105
  - lib/net/scp/errors.rb
104
106
  - lib/net/scp/upload.rb
105
107
  - lib/net/scp/version.rb
108
+ - lib/net/scp/version.rb.old
106
109
  - lib/uri/open-scp.rb
107
110
  - lib/uri/scp.rb
108
111
  - net-scp-public_cert.pem
@@ -128,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
131
  - !ruby/object:Gem::Version
129
132
  version: '0'
130
133
  requirements: []
131
- rubygems_version: 3.1.6
134
+ rubygems_version: 3.3.3
132
135
  signing_key:
133
136
  specification_version: 3
134
137
  summary: A pure Ruby implementation of the SCP client protocol.
metadata.gz.sig CHANGED
Binary file
data/.travis.yml DELETED
@@ -1,16 +0,0 @@
1
- language: ruby
2
- cache: bundler
3
- rvm:
4
- - 2.3.8
5
- - 2.4.5
6
- - 2.5.3
7
- - 2.6.1
8
- - ruby-head
9
-
10
- matrix:
11
- allow_failures:
12
- - rvm: ruby-head
13
-
14
- install: gem install jeweler test-unit mocha net-ssh
15
-
16
- script: rake test
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.