net-scp 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,7 @@
1
+ === 1.0.4 / 16 Sep 2010
2
+
3
+ * maintain filename sanitization compatibility with ruby 1.8.6 [Sung Pae, Tim Charper]
4
+
1
5
  === 1.0.3 / 17 Aug 2010
2
6
 
3
7
  * replace :sanitize_file_name with a call to String#shellescape [Sung Pae]
data/Rakefile CHANGED
@@ -41,6 +41,7 @@ Rake::GemPackageTask.new(@spec) do |p|
41
41
  end
42
42
 
43
43
  task :release => [ :rdoc, :package ]
44
+ task :build => [ :package ]
44
45
  task :install => [ :rdoc, :package ] do
45
46
  sh %{sudo gem install pkg/#{name}-#{version}.gem}
46
47
  end
@@ -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.shellescape}"
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
 
@@ -6,7 +6,7 @@ module Net; class SCP
6
6
  class Version < Net::SSH::Version
7
7
  MAJOR = 1
8
8
  MINOR = 0
9
- TINY = 3
9
+ TINY = 4
10
10
 
11
11
  # The current version, as a Version instance
12
12
  CURRENT = new(MAJOR, MINOR, TINY)
@@ -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.3"
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{jamis@jamisbuck.org}
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: 17
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 3
10
- version: 1.0.3
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: jamis@jamisbuck.org
39
+ email: net-scp@solutious.com
40
40
  executables: []
41
41
 
42
42
  extensions: []