net-scp 4.2.0 → 4.2.1
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/CHANGES.txt +4 -0
- data/README.md +5 -0
- data/lib/net/scp/version.rb +1 -1
- data/lib/net/scp.rb +10 -1
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ee8ac18a34abb6482265e9cef492d7a2988d821feeda9bd25b13158ae9676987
|
|
4
|
+
data.tar.gz: b35016e03ea18a6a707e6c9f0236930db49fe6ba33e2e675b910b6913f525419
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d3a721c9a2310e338dc12f6f06bc712a3b0961f3236de4f69584541c04b2b4b83caf26954b104b8b4a834a93e8e5a4e50167057d7d9d238455d2012f6754ada6
|
|
7
|
+
data.tar.gz: aa7d1a69eeb9d67f622ca4af00576c91938bc39c68ce23e57a70b7ff2f156ec3337ecbc0c6fa4edf52780ce1a0ea95e8090e1fd53a23be42e46e86b675dcf8b2
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/CHANGES.txt
CHANGED
data/README.md
CHANGED
|
@@ -47,6 +47,11 @@ Net::SCP.download!("remote.host.com", "username",
|
|
|
47
47
|
"/remote/path", "/local/path",
|
|
48
48
|
:ssh => { :password => "password" })
|
|
49
49
|
|
|
50
|
+
# download with the bandwidth limited to 400 Kbit/s, like `scp -l 400`
|
|
51
|
+
Net::SCP.download!("remote.host.com", "username",
|
|
52
|
+
"/remote/path", "/local/path",
|
|
53
|
+
:ssh => { :password => "password" }, :limit => 400)
|
|
54
|
+
|
|
50
55
|
# download a file to an in-memory buffer
|
|
51
56
|
data = Net::SCP::download!("remote.host.com", "username", "/remote/path")
|
|
52
57
|
|
data/lib/net/scp/version.rb
CHANGED
data/lib/net/scp.rb
CHANGED
|
@@ -94,6 +94,7 @@ module Net
|
|
|
94
94
|
# be sent to indicate the modification and access times of each file.
|
|
95
95
|
# * "-r" -- recursive transfers should be allowed. Without this, it is an
|
|
96
96
|
# error to upload or download a directory.
|
|
97
|
+
# * "-l" -- limit the bandwidth used by the transfer, in Kbit/s.
|
|
97
98
|
#
|
|
98
99
|
# After those flags, the name of the remote file/directory should be passed
|
|
99
100
|
# as the sole non-switch argument to scp.
|
|
@@ -267,6 +268,8 @@ module Net
|
|
|
267
268
|
# * :chunk_size - the size of each "chunk" that should be sent. Defaults
|
|
268
269
|
# to 2048. Changing this value may improve throughput at the expense
|
|
269
270
|
# of decreasing interactivity.
|
|
271
|
+
# * :limit - the bandwidth limit in Kbit/s, a positive Integer, like
|
|
272
|
+
# <tt>scp -l</tt>. The remote scp enforces it.
|
|
270
273
|
# * :quote - how +remote+ is quoted in the scp command run by the remote
|
|
271
274
|
# shell. :posix (the default) escapes it for a POSIX shell, leaving a
|
|
272
275
|
# leading "~" or "~/" unescaped so it expands to the remote home
|
|
@@ -309,6 +312,7 @@ module Net
|
|
|
309
312
|
# * :preserve - the atime and mtime of the file should be preserved.
|
|
310
313
|
# * :verbose - the process should result in verbose output on the server
|
|
311
314
|
# end (useful for debugging).
|
|
315
|
+
# * :limit - the bandwidth limit in Kbit/s (see #upload).
|
|
312
316
|
# * :quote - how +remote+ is quoted for the remote shell (see #upload).
|
|
313
317
|
#
|
|
314
318
|
# This method will return immediately, returning the Net::SSH::Connection::Channel
|
|
@@ -343,7 +347,7 @@ module Net
|
|
|
343
347
|
|
|
344
348
|
# Constructs the scp command line needed to initiate and SCP session
|
|
345
349
|
# for the given +mode+ (:upload or :download) and with the given options
|
|
346
|
-
# (:verbose, :recursive, :preserve). Returns the command-line as a
|
|
350
|
+
# (:verbose, :recursive, :preserve, :limit). Returns the command-line as a
|
|
347
351
|
# string, ready to execute.
|
|
348
352
|
def scp_command(mode, options)
|
|
349
353
|
command = +"scp "
|
|
@@ -351,6 +355,11 @@ module Net
|
|
|
351
355
|
command << " -v" if options[:verbose]
|
|
352
356
|
command << " -r" if options[:recursive]
|
|
353
357
|
command << " -p" if options[:preserve]
|
|
358
|
+
limit = options[:limit]
|
|
359
|
+
unless limit.nil?
|
|
360
|
+
raise ArgumentError, ":limit must be a positive Integer" unless limit.is_a?(Integer) && limit > 0
|
|
361
|
+
command << " -l #{limit}"
|
|
362
|
+
end
|
|
354
363
|
command
|
|
355
364
|
end
|
|
356
365
|
|
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.2.
|
|
4
|
+
version: 4.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jamis Buck
|
|
@@ -32,7 +32,7 @@ cert_chain:
|
|
|
32
32
|
vNiMFH5yLu/tlav4xh+HlYscWVdFQIvd7f/Uxa+Vip1Pi16wmhnrE15z/vDX921v
|
|
33
33
|
hukBRIoCEAuUgNVBh+L/C8aETzbf/77WU3Si/w==
|
|
34
34
|
-----END CERTIFICATE-----
|
|
35
|
-
date: 2026-
|
|
35
|
+
date: 2026-11-02 00:00:00.000000000 Z
|
|
36
36
|
dependencies:
|
|
37
37
|
- !ruby/object:Gem::Dependency
|
|
38
38
|
name: net-ssh
|
metadata.gz.sig
CHANGED
|
Binary file
|