ztk 1.6.21 → 1.6.22

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.
@@ -133,7 +133,7 @@ module ZTK
133
133
 
134
134
  retry
135
135
  else
136
- options.ui.logger.fatal { "Caught #{e.inspect} and we have no more tries left, sorry, we have to give up now." }
136
+ options.ui.logger.fatal { "Caught #{e.inspect} and we have no more tries left! We have to give up now!" }
137
137
 
138
138
  raise e
139
139
  end
@@ -44,13 +44,9 @@ module ZTK
44
44
  command << remote_tempfile
45
45
  command = command.join(' ')
46
46
 
47
- result = nil
47
+ self.upload(local_tempfile.path, remote_tempfile)
48
48
 
49
- ZTK::RescueRetry.try(:ui => config.ui, :tries => 3, :on_retry => method(:on_retry)) do
50
- self.upload(local_tempfile.path, remote_tempfile)
51
-
52
- result = self.exec(command, options)
53
- end
49
+ result = self.exec(command, options)
54
50
 
55
51
  local_tempfile.close!
56
52
 
@@ -9,6 +9,7 @@ module ZTK
9
9
  # Primarily used internally.
10
10
  def ssh
11
11
  @ssh ||= Net::SSH.start(config.host_name, config.user, ssh_options)
12
+ @ssh
12
13
  end
13
14
 
14
15
  # Starts an SFTP session. Can also be used to get the Net::SFTP object.
@@ -16,14 +17,15 @@ module ZTK
16
17
  # Primarily used internally.
17
18
  def sftp
18
19
  @sftp ||= self.ssh.sftp
20
+ @sftp
19
21
  end
20
22
 
21
23
  # Close our session gracefully.
22
24
  def close
23
25
  config.ui.logger.debug { "close" }
24
26
 
25
- if (ssh && !ssh.closed?)
26
- ssh.close
27
+ if (@ssh && !@ssh.closed?)
28
+ @ssh.close
27
29
  end
28
30
 
29
31
  @ssh = nil
@@ -36,14 +36,12 @@ module ZTK
36
36
  !block.nil? and block.call(local_tempfile)
37
37
  local_tempfile.respond_to?(:flush) and local_tempfile.flush
38
38
 
39
- ZTK::RescueRetry.try(:ui => config.ui, :tries => 3, :on_retry => method(:on_retry)) do
40
- self.upload(local_tempfile.path, remote_tempfile)
39
+ self.upload(local_tempfile.path, remote_tempfile)
41
40
 
42
- self.exec(%(sudo mv -fv #{remote_tempfile} #{target}), :silence => true)
41
+ self.exec(%(sudo mv -fv #{remote_tempfile} #{target}), :silence => true)
43
42
 
44
- chown.nil? or self.exec(%(sudo chown -v #{chown} #{target}), :silence => true)
45
- chmod.nil? or self.exec(%(sudo chmod -v #{chmod} #{target}), :silence => true)
46
- end
43
+ chown.nil? or self.exec(%(sudo chown -v #{chown} #{target}), :silence => true)
44
+ chmod.nil? or self.exec(%(sudo chmod -v #{chmod} #{target}), :silence => true)
47
45
 
48
46
  local_tempfile.close!
49
47
 
@@ -1,6 +1,6 @@
1
1
  module ZTK
2
2
 
3
3
  # ZTK Version String
4
- VERSION = "1.6.21"
4
+ VERSION = "1.6.22"
5
5
 
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ztk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.21
4
+ version: 1.6.22
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-11 00:00:00.000000000 Z
12
+ date: 2013-07-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -275,7 +275,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
275
275
  version: '0'
276
276
  segments:
277
277
  - 0
278
- hash: -3636631208901024067
278
+ hash: -4037562965285202835
279
279
  required_rubygems_version: !ruby/object:Gem::Requirement
280
280
  none: false
281
281
  requirements:
@@ -284,7 +284,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
284
284
  version: '0'
285
285
  segments:
286
286
  - 0
287
- hash: -3636631208901024067
287
+ hash: -4037562965285202835
288
288
  requirements: []
289
289
  rubyforge_project:
290
290
  rubygems_version: 1.8.25