ztk 0.2.3 → 0.2.4

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.
Files changed (3) hide show
  1. data/lib/ztk/command.rb +8 -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, command)
68
+ def log_header(tag)
69
69
  count = 8
70
70
  sep = ("=" * count)
71
- header = [sep, "[ #{tag} ]", sep, "[ #{self.inspect} ]", sep, "[ #{command} ]", sep, "[ #{tag} ]", sep].join
71
+ header = [sep, "[ #{tag} ]", sep, "[ #{self.inspect} ]", sep, "[ #{tag} ]", sep].join
72
72
  "#{header}\n"
73
73
  end
74
74
 
@@ -102,7 +102,9 @@ 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", command) }
105
+ direct_log(:debug) { log_header("COMMAND") }
106
+ direct_log(:debug) { "#{command}\n" }
107
+ direct_log(:debug) { log_header("STARTED") }
106
108
  loop do
107
109
  break if reader_writer_map.keys.all?{ |reader| reader.eof? }
108
110
 
@@ -114,7 +116,7 @@ module ZTK
114
116
  case reader_writer_key[socket]
115
117
  when :stdout then
116
118
  if !stdout_header
117
- direct_log(:debug) { log_header("STDOUT", command) }
119
+ direct_log(:debug) { log_header("STDOUT") }
118
120
  stdout_header = true
119
121
  stderr_header = false
120
122
  end
@@ -123,7 +125,7 @@ module ZTK
123
125
 
124
126
  when :stderr then
125
127
  if !stderr_header
126
- direct_log(:warn) { log_header("STDERR", command) }
128
+ direct_log(:warn) { log_header("STDERR") }
127
129
  stderr_header = true
128
130
  stdout_header = false
129
131
  end
@@ -134,7 +136,7 @@ module ZTK
134
136
  output += data
135
137
  end
136
138
  end
137
- direct_log(:debug) { log_header("STOPPED", command) }
139
+ direct_log(:debug) { log_header("STOPPED") }
138
140
 
139
141
  Process.waitpid(pid)
140
142
 
@@ -19,5 +19,5 @@
19
19
  ################################################################################
20
20
 
21
21
  module ZTK
22
- VERSION = "0.2.3" unless const_defined?(:VERSION)
22
+ VERSION = "0.2.4" 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.3
4
+ version: 0.2.4
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: -1081649697507716788
215
+ hash: 1620361710254805055
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: -1081649697507716788
224
+ hash: 1620361710254805055
225
225
  requirements: []
226
226
  rubyforge_project:
227
227
  rubygems_version: 1.8.24