net-scp 1.0.3 → 1.0.4
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.
- data/CHANGELOG.rdoc +4 -0
- data/Rakefile +1 -0
- data/lib/net/scp.rb +22 -1
- data/lib/net/scp/version.rb +1 -1
- data/net-scp.gemspec +2 -2
- metadata +4 -4
data/CHANGELOG.rdoc
CHANGED
data/Rakefile
CHANGED
data/lib/net/scp.rb
CHANGED
@@ -338,7 +338,7 @@ module Net
|
|
338
338
|
# (See Net::SCP::Upload and Net::SCP::Download).
|
339
339
|
def start_command(mode, local, remote, options={}, &callback)
|
340
340
|
session.open_channel do |channel|
|
341
|
-
command = "#{scp_command(mode, options)} #{remote
|
341
|
+
command = "#{scp_command(mode, options)} #{shellescape remote}"
|
342
342
|
channel.exec(command) do |ch, success|
|
343
343
|
if success
|
344
344
|
channel[:local ] = local
|
@@ -399,6 +399,27 @@ module Net
|
|
399
399
|
def progress_callback(channel, name, sent, total)
|
400
400
|
channel[:callback].call(channel, name, sent, total) if channel[:callback]
|
401
401
|
end
|
402
|
+
|
403
|
+
# Imported from ruby 1.9.2 shellwords.rb
|
404
|
+
def shellescape(str)
|
405
|
+
# ruby 1.8.7+ implements String#shellescape
|
406
|
+
return str.shellescape if str.respond_to? :shellescape
|
407
|
+
|
408
|
+
# An empty argument will be skipped, so return empty quotes.
|
409
|
+
return "''" if str.empty?
|
410
|
+
|
411
|
+
str = str.dup
|
412
|
+
|
413
|
+
# Process as a single byte sequence because not all shell
|
414
|
+
# implementations are multibyte aware.
|
415
|
+
str.gsub!(/([^A-Za-z0-9_\-.,:\/@\n])/n, "\\\\\\1")
|
416
|
+
|
417
|
+
# A LF cannot be escaped with a backslash because a backslash + LF
|
418
|
+
# combo is regarded as line continuation and simply ignored.
|
419
|
+
str.gsub!(/\n/, "'\n'")
|
420
|
+
|
421
|
+
return str
|
422
|
+
end
|
402
423
|
end
|
403
424
|
end
|
404
425
|
|
data/lib/net/scp/version.rb
CHANGED
data/net-scp.gemspec
CHANGED
@@ -2,13 +2,13 @@
|
|
2
2
|
|
3
3
|
@spec = Gem::Specification.new do |s|
|
4
4
|
s.name = %q{net-scp}
|
5
|
-
s.version = "1.0.
|
5
|
+
s.version = "1.0.4"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Jamis Buck", "Delano Mandelbaum"]
|
9
9
|
s.date = %q{2010-08-17}
|
10
10
|
s.description = %q{A pure Ruby implementation of the SCP client protocol}
|
11
|
-
s.email = %q{
|
11
|
+
s.email = %q{net-scp@solutious.com}
|
12
12
|
s.extra_rdoc_files = ["CHANGELOG.rdoc", "lib/net/scp/download.rb", "lib/net/scp/errors.rb", "lib/net/scp/upload.rb", "lib/net/scp/version.rb", "lib/net/scp.rb", "lib/uri/open-scp.rb", "lib/uri/scp.rb", "README.rdoc"]
|
13
13
|
s.files = ["CHANGELOG.rdoc", "lib/net/scp/download.rb", "lib/net/scp/errors.rb", "lib/net/scp/upload.rb", "lib/net/scp/version.rb", "lib/net/scp.rb", "lib/uri/open-scp.rb", "lib/uri/scp.rb", "Rakefile", "README.rdoc", "setup.rb", "test/common.rb", "test/test_all.rb", "test/test_download.rb", "test/test_scp.rb", "test/test_upload.rb", "Manifest", "net-scp.gemspec"]
|
14
14
|
s.homepage = %q{http://net-ssh.rubyforge.org/scp}
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: net-scp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 4
|
10
|
+
version: 1.0.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jamis Buck
|
@@ -36,7 +36,7 @@ dependencies:
|
|
36
36
|
type: :runtime
|
37
37
|
version_requirements: *id001
|
38
38
|
description: A pure Ruby implementation of the SCP client protocol
|
39
|
-
email:
|
39
|
+
email: net-scp@solutious.com
|
40
40
|
executables: []
|
41
41
|
|
42
42
|
extensions: []
|