maestro_shell 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/util/shell.rb +13 -9
- data/lib/util/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7202e558e1c7bc226196fa6580f929837523680a
|
4
|
+
data.tar.gz: 2c56889dba049af09e23c1ad5fd9c888d3658df8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1671da72da032d007631ba2e9761f5ad2914e6aae54c334ecce0b4694e7f54660fda8cdfb93130d0761bc4814292e63f884aca5705d5a706d7ef73e4cbb39f93
|
7
|
+
data.tar.gz: 6c820aadf68fd69a0e0c98862584226e0c4fa398686e5b08f68c445de08bd62f5b0bc5e4beec3e0bed78a697886873a8416840dbd007a1ffff6410e4fac2be18
|
data/Gemfile.lock
CHANGED
data/lib/util/shell.rb
CHANGED
@@ -76,22 +76,26 @@ module Maestro
|
|
76
76
|
def run_script_with_delegate(delegate, on_output)
|
77
77
|
File.open(@output_file.path, 'a') do |out_file|
|
78
78
|
status = IO.popen4(@command_line) do |pid, stdin, stdout, stderr|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
79
|
+
# Keep reading input until all (stdin/stderr) streams report eof
|
80
|
+
readers = [stdout, stderr]
|
81
|
+
while readers.any?
|
82
|
+
ready = IO.select(readers, [], readers)
|
83
|
+
# no writers
|
84
|
+
# ready[1].each { ... }
|
85
|
+
ready[0].each do |fd|
|
86
|
+
if fd.eof?
|
87
|
+
readers.delete fd
|
88
|
+
else
|
89
|
+
|
90
|
+
text = fd.readpartial(1024)
|
84
91
|
out_file.write(text)
|
85
92
|
|
86
93
|
if delegate && on_output
|
87
|
-
delegate.send(on_output, text,
|
94
|
+
delegate.send(on_output, text, fd == stderr)
|
88
95
|
end
|
89
96
|
end
|
90
97
|
end
|
91
98
|
end
|
92
|
-
|
93
|
-
# Wait for stream handler threads to exit
|
94
|
-
threads.each { |t| t.join }
|
95
99
|
end
|
96
100
|
end
|
97
101
|
|
data/lib/util/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: maestro_shell
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Doug Henderson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-07-
|
11
|
+
date: 2013-07-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logging
|