ztk 0.2.2 → 0.2.3

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 +6 -6
  2. data/lib/ztk/version.rb +1 -1
  3. metadata +3 -3
@@ -65,10 +65,10 @@ module ZTK
65
65
  # puts cmd.exec("hostname -f").inspect
66
66
  def exec(command, options={})
67
67
 
68
- def log_header(tag)
68
+ def log_header(tag, command)
69
69
  count = 8
70
70
  sep = ("=" * count)
71
- header = [sep, "[ #{tag} ]", sep, "[ #{self.inspect} ]", sep, "[ #{tag} ]", sep].join
71
+ header = [sep, "[ #{tag} ]", sep, "[ #{self.inspect} ]", sep, "[ #{command} ]", sep, "[ #{tag} ]", sep].join
72
72
  "#{header}\n"
73
73
  end
74
74
 
@@ -102,7 +102,7 @@ module ZTK
102
102
  reader_writer_key = {parent_stdout_reader => :stdout, parent_stderr_reader => :stderr}
103
103
  reader_writer_map = {parent_stdout_reader => @config.stdout, parent_stderr_reader => @config.stderr}
104
104
 
105
- direct_log(:debug) { log_header("STARTED") }
105
+ direct_log(:debug) { log_header("STARTED", command) }
106
106
  loop do
107
107
  break if reader_writer_map.keys.all?{ |reader| reader.eof? }
108
108
 
@@ -114,7 +114,7 @@ module ZTK
114
114
  case reader_writer_key[socket]
115
115
  when :stdout then
116
116
  if !stdout_header
117
- direct_log(:debug) { log_header("STDOUT") }
117
+ direct_log(:debug) { log_header("STDOUT", command) }
118
118
  stdout_header = true
119
119
  stderr_header = false
120
120
  end
@@ -123,7 +123,7 @@ module ZTK
123
123
 
124
124
  when :stderr then
125
125
  if !stderr_header
126
- direct_log(:warn) { log_header("STDERR") }
126
+ direct_log(:warn) { log_header("STDERR", command) }
127
127
  stderr_header = true
128
128
  stdout_header = false
129
129
  end
@@ -134,7 +134,7 @@ module ZTK
134
134
  output += data
135
135
  end
136
136
  end
137
- direct_log(:debug) { log_header("STOPPED") }
137
+ direct_log(:debug) { log_header("STOPPED", command) }
138
138
 
139
139
  Process.waitpid(pid)
140
140
 
@@ -19,5 +19,5 @@
19
19
  ################################################################################
20
20
 
21
21
  module ZTK
22
- VERSION = "0.2.2" unless const_defined?(:VERSION)
22
+ VERSION = "0.2.3" unless const_defined?(:VERSION)
23
23
  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: 0.2.2
4
+ version: 0.2.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -212,7 +212,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
212
212
  version: '0'
213
213
  segments:
214
214
  - 0
215
- hash: -3237864687113483412
215
+ hash: -1081649697507716788
216
216
  required_rubygems_version: !ruby/object:Gem::Requirement
217
217
  none: false
218
218
  requirements:
@@ -221,7 +221,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
221
221
  version: '0'
222
222
  segments:
223
223
  - 0
224
- hash: -3237864687113483412
224
+ hash: -1081649697507716788
225
225
  requirements: []
226
226
  rubyforge_project:
227
227
  rubygems_version: 1.8.24