ztk 1.0.4 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/ztk/ssh.rb +12 -1
  2. data/lib/ztk/version.rb +1 -1
  3. metadata +4 -4
data/lib/ztk/ssh.rb CHANGED
@@ -130,6 +130,8 @@ module ZTK
130
130
  # @option config [String] :proxy_host_name Server hostname to proxy through.
131
131
  # @option config [String] :proxy_user Username to use for proxy
132
132
  # authentication.
133
+ # @option config [Boolean] :request_pty Weither or not we should try to
134
+ # obtain a PTY
133
135
  # @option config [String, Array<String>] :proxy_keys A single or series of
134
136
  # identity files to use for authentication with the proxy.
135
137
  def initialize(configuration={})
@@ -138,7 +140,8 @@ module ZTK
138
140
  :compression => false,
139
141
  :user_known_hosts_file => '/dev/null',
140
142
  :timeout => 60,
141
- :ignore_exit_status => false
143
+ :ignore_exit_status => false,
144
+ :request_pty => true
142
145
  }.merge(configuration))
143
146
  config.ui.logger.debug { "config=#{config.send(:table).inspect}" }
144
147
  end
@@ -223,6 +226,14 @@ module ZTK
223
226
  channel = ssh.open_channel do |chan|
224
227
  options.ui.logger.debug { "Channel opened." }
225
228
 
229
+ (options.request_pty == true) and chan.request_pty do |ch, success|
230
+ if success
231
+ options.ui.logger.debug { "PTY obtained." }
232
+ else
233
+ options.ui.logger.warn { "Could not obtain PTY." }
234
+ end
235
+ end
236
+
226
237
  direct_log(:info) { log_header("COMMAND") }
227
238
  direct_log(:info) { "#{command}\n" }
228
239
  direct_log(:info) { log_header("OPENED") }
data/lib/ztk/version.rb CHANGED
@@ -21,6 +21,6 @@
21
21
  module ZTK
22
22
 
23
23
  # ZTK Version String
24
- VERSION = "1.0.4"
24
+ VERSION = "1.0.5"
25
25
 
26
26
  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.0.4
4
+ version: 1.0.5
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-02-24 00:00:00.000000000 Z
12
+ date: 2013-03-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: erubis
@@ -250,7 +250,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
250
250
  version: '0'
251
251
  segments:
252
252
  - 0
253
- hash: 1589167038471120056
253
+ hash: -3842660974707417697
254
254
  required_rubygems_version: !ruby/object:Gem::Requirement
255
255
  none: false
256
256
  requirements:
@@ -259,7 +259,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
259
259
  version: '0'
260
260
  segments:
261
261
  - 0
262
- hash: 1589167038471120056
262
+ hash: -3842660974707417697
263
263
  requirements: []
264
264
  rubyforge_project:
265
265
  rubygems_version: 1.8.24