ztk 1.5.0 → 1.5.1

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/command.rb +5 -5
  2. data/lib/ztk/version.rb +1 -1
  3. metadata +3 -3
@@ -115,9 +115,8 @@ module ZTK
115
115
  begin
116
116
  Timeout.timeout(options.timeout) do
117
117
  loop do
118
- pipes = IO.select(reader_writer_map.keys, [], reader_writer_map.keys).first
119
- pipes.each do |pipe|
120
- data = pipe.read
118
+ reader_writer_map.keys.each do |pipe|
119
+ data = (pipe.readpartial(1024) rescue nil)
121
120
  next if (data.nil? || data.empty?)
122
121
 
123
122
  case reader_writer_key[pipe]
@@ -143,6 +142,7 @@ module ZTK
143
142
  output += data
144
143
  end
145
144
  break if reader_writer_map.keys.all?{ |reader| reader.eof? }
145
+ sleep(0.1)
146
146
  end
147
147
  end
148
148
  rescue Timeout::Error => e
@@ -184,8 +184,8 @@ module ZTK
184
184
  # Returns a string in the format of "user@hostname" for the current
185
185
  # shell.
186
186
  def tag
187
- @@hostname ||= %x(hostname).chomp
188
- "#{ENV['USER']}@#{@hostname}"
187
+ @@hostname ||= %x(hostname).split('.').first.strip
188
+ "#{ENV['USER']}@#{@@hostname}"
189
189
  end
190
190
 
191
191
  # Formats a header suitable for writing to the direct logger when logging
@@ -1,6 +1,6 @@
1
1
  module ZTK
2
2
 
3
3
  # ZTK Version String
4
- VERSION = "1.5.0"
4
+ VERSION = "1.5.1"
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.5.0
4
+ version: 1.5.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -281,7 +281,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
281
281
  version: '0'
282
282
  segments:
283
283
  - 0
284
- hash: -3936130905649481277
284
+ hash: -953822928743577515
285
285
  required_rubygems_version: !ruby/object:Gem::Requirement
286
286
  none: false
287
287
  requirements:
@@ -290,7 +290,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
290
290
  version: '0'
291
291
  segments:
292
292
  - 0
293
- hash: -3936130905649481277
293
+ hash: -953822928743577515
294
294
  requirements: []
295
295
  rubyforge_project:
296
296
  rubygems_version: 1.8.25