net-sftp 2.0.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.rdoc CHANGED
@@ -1,3 +1,8 @@
1
+ === 2.0.2 / 1 Feb 2009
2
+
3
+ * Avoid using 'ensure' in Net::SFTP.start since it causes unfriendly behavior when exceptions are raised [Jamis Buck]
4
+
5
+
1
6
  === 2.0.1 / 29 May 2008
2
7
 
3
8
  * Open files in binary mode to appease Windows [Jamis Buck]
data/Rakefile CHANGED
@@ -21,10 +21,10 @@ Echoe.new('net-sftp', version) do |p|
21
21
  p.summary = "A pure Ruby implementation of the SFTP client protocol"
22
22
  p.url = "http://net-ssh.rubyforge.org/sftp"
23
23
 
24
- p.dependencies = ["net-ssh >=1.99.1"]
24
+ p.dependencies = ["net-ssh >=2.0.9"]
25
25
 
26
26
  p.need_zip = true
27
27
  p.include_rakefile = true
28
28
 
29
29
  p.rdoc_pattern = /^(lib|README.rdoc|CHANGELOG.rdoc)/
30
- end
30
+ end
data/lib/net/sftp.rb CHANGED
@@ -31,11 +31,21 @@ module Net
31
31
  session = Net::SSH.start(host, user, options)
32
32
  sftp = Net::SFTP::Session.new(session, &block).connect!
33
33
 
34
- sftp.loop if block_given?
34
+ if block_given?
35
+ sftp.loop
36
+ session.close
37
+ return nil
38
+ end
35
39
 
36
40
  sftp
37
- ensure
38
- session.close if session && block_given?
41
+ rescue Object => anything
42
+ begin
43
+ session.shutdown!
44
+ rescue Exception
45
+ # swallow exceptions that occur while trying to shutdown
46
+ end
47
+
48
+ raise anything
39
49
  end
40
50
  end
41
51
 
@@ -57,4 +67,4 @@ class Net::SSH::Connection::Session
57
67
  sftp
58
68
  end
59
69
  end
60
- end
70
+ end
@@ -6,7 +6,7 @@ module Net; module SFTP
6
6
  class Version < Net::SSH::Version
7
7
  MAJOR = 2
8
8
  MINOR = 0
9
- TINY = 1
9
+ TINY = 2
10
10
 
11
11
  # The current version, as a Version instance
12
12
  CURRENT = new(MAJOR, MINOR, TINY)
data/net-sftp.gemspec CHANGED
@@ -1,16 +1,10 @@
1
-
2
- # Gem::Specification for Net-sftp-2.0.1
3
- # Originally generated by Echoe
4
-
5
1
  Gem::Specification.new do |s|
6
2
  s.name = %q{net-sftp}
7
- s.version = "2.0.1"
8
-
9
- s.specification_version = 2 if s.respond_to? :specification_version=
3
+ s.version = "2.0.2"
10
4
 
11
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
5
+ s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
12
6
  s.authors = ["Jamis Buck"]
13
- s.date = %q{2008-05-29}
7
+ s.date = %q{2009-02-01}
14
8
  s.description = %q{A pure Ruby implementation of the SFTP client protocol}
15
9
  s.email = %q{jamis@jamisbuck.org}
16
10
  s.extra_rdoc_files = ["CHANGELOG.rdoc", "lib/net/sftp/constants.rb", "lib/net/sftp/errors.rb", "lib/net/sftp/operations/dir.rb", "lib/net/sftp/operations/download.rb", "lib/net/sftp/operations/file.rb", "lib/net/sftp/operations/file_factory.rb", "lib/net/sftp/operations/upload.rb", "lib/net/sftp/packet.rb", "lib/net/sftp/protocol/01/attributes.rb", "lib/net/sftp/protocol/01/base.rb", "lib/net/sftp/protocol/01/name.rb", "lib/net/sftp/protocol/02/base.rb", "lib/net/sftp/protocol/03/base.rb", "lib/net/sftp/protocol/04/attributes.rb", "lib/net/sftp/protocol/04/base.rb", "lib/net/sftp/protocol/04/name.rb", "lib/net/sftp/protocol/05/base.rb", "lib/net/sftp/protocol/06/attributes.rb", "lib/net/sftp/protocol/06/base.rb", "lib/net/sftp/protocol/base.rb", "lib/net/sftp/protocol.rb", "lib/net/sftp/request.rb", "lib/net/sftp/response.rb", "lib/net/sftp/session.rb", "lib/net/sftp/version.rb", "lib/net/sftp.rb", "README.rdoc"]
@@ -20,43 +14,23 @@ Gem::Specification.new do |s|
20
14
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Net-sftp", "--main", "README.rdoc"]
21
15
  s.require_paths = ["lib"]
22
16
  s.rubyforge_project = %q{net-ssh}
23
- s.rubygems_version = %q{1.1.1}
17
+ s.rubygems_version = %q{1.2.0}
24
18
  s.summary = %q{A pure Ruby implementation of the SFTP client protocol}
25
19
  s.test_files = ["test/test_all.rb"]
26
20
 
27
- s.add_dependency(%q<net-ssh>, [">= 1.99.1"])
28
- end
29
-
21
+ if s.respond_to? :specification_version then
22
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
23
+ s.specification_version = 2
30
24
 
31
- # # Original Rakefile source (requires the Echoe gem):
32
- #
33
- # $LOAD_PATH.unshift "../net-ssh/lib"
34
- # require './lib/net/sftp/version'
35
- #
36
- # begin
37
- # require 'echoe'
38
- # rescue LoadError
39
- # abort "You'll need to have `echoe' installed to use Net::SFTP's Rakefile"
40
- # end
41
- #
42
- # version = Net::SFTP::Version::STRING.dup
43
- # if ENV['SNAPSHOT'].to_i == 1
44
- # version << "." << Time.now.utc.strftime("%Y%m%d%H%M%S")
45
- # end
46
- #
47
- # Echoe.new('net-sftp', version) do |p|
48
- # p.project = "net-ssh"
49
- # p.changelog = "CHANGELOG.rdoc"
50
- #
51
- # p.author = "Jamis Buck"
52
- # p.email = "jamis@jamisbuck.org"
53
- # p.summary = "A pure Ruby implementation of the SFTP client protocol"
54
- # p.url = "http://net-ssh.rubyforge.org/sftp"
55
- #
56
- # p.dependencies = ["net-ssh >=1.99.1"]
57
- #
58
- # p.need_zip = true
59
- # p.include_rakefile = true
60
- #
61
- # p.rdoc_pattern = /^(lib|README.rdoc|CHANGELOG.rdoc)/
62
- # end
25
+ if current_version >= 3 then
26
+ s.add_runtime_dependency(%q<net-ssh>, [">= 2.0.9"])
27
+ s.add_development_dependency(%q<echoe>, [">= 0"])
28
+ else
29
+ s.add_dependency(%q<net-ssh>, [">= 2.0.9"])
30
+ s.add_dependency(%q<echoe>, [">= 0"])
31
+ end
32
+ else
33
+ s.add_dependency(%q<net-ssh>, [">= 2.0.9"])
34
+ s.add_dependency(%q<echoe>, [">= 0"])
35
+ end
36
+ end
data/test/common.rb CHANGED
@@ -2,15 +2,13 @@ require 'test/unit'
2
2
  require 'mocha'
3
3
 
4
4
  begin
5
- gem 'net-ssh', ">= 2.0.0"
6
5
  require 'net/ssh'
6
+ require 'net/ssh/version'
7
+ raise LoadError, "wrong version" unless Net::SSH::Version::STRING >= '1.99.0'
7
8
  rescue LoadError
8
- $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../../net-ssh/lib"
9
-
10
9
  begin
10
+ gem 'net-ssh', ">= 2.0.0"
11
11
  require 'net/ssh'
12
- require 'net/ssh/version'
13
- raise LoadError, "wrong version" unless Net::SSH::Version::STRING >= '1.99.0'
14
12
  rescue LoadError => e
15
13
  abort "could not load net/ssh v2 (#{e.inspect})"
16
14
  end
@@ -170,4 +168,4 @@ module Protocol
170
168
  module V04; end
171
169
  module V05; end
172
170
  module V06; end
173
- end
171
+ end
@@ -11,7 +11,11 @@ class Protocol::V04::TestName < Net::SFTP::TestCase
11
11
  end
12
12
 
13
13
  def teardown
14
- ENV['TZ'] = @save_tz
14
+ if @save_tz
15
+ ENV['TZ'] = @save_tz
16
+ else
17
+ ENV.delete('TZ')
18
+ end
15
19
  end
16
20
 
17
21
  def test_directory?
@@ -46,4 +50,4 @@ class Protocol::V04::TestName < Net::SFTP::TestCase
46
50
  assert_equal "-rwxr-xr-x jamis users 10240 Mar 12 03:40 test",
47
51
  @file.longname
48
52
  end
49
- end
53
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: net-sftp
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jamis Buck
@@ -9,17 +9,28 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-05-29 00:00:00 -06:00
12
+ date: 2009-02-01 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: net-ssh
17
+ type: :runtime
17
18
  version_requirement:
18
19
  version_requirements: !ruby/object:Gem::Requirement
19
20
  requirements:
20
21
  - - ">="
21
22
  - !ruby/object:Gem::Version
22
- version: 1.99.1
23
+ version: 2.0.9
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: echoe
27
+ type: :development
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: "0"
23
34
  version:
24
35
  description: A pure Ruby implementation of the SFTP client protocol
25
36
  email: jamis@jamisbuck.org
@@ -135,12 +146,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
135
146
  requirements:
136
147
  - - ">="
137
148
  - !ruby/object:Gem::Version
138
- version: "0"
149
+ version: "1.2"
139
150
  version:
140
151
  requirements: []
141
152
 
142
153
  rubyforge_project: net-ssh
143
- rubygems_version: 1.1.1
154
+ rubygems_version: 1.2.0
144
155
  signing_key:
145
156
  specification_version: 2
146
157
  summary: A pure Ruby implementation of the SFTP client protocol