pretty_multitask 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pretty_multitask/run_callable.rb +11 -8
- data/lib/pretty_multitask/runner.rb +1 -0
- data/lib/pretty_multitask/version.rb +1 -1
- data/lib/pretty_multitask.rb +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 855e2f7b1a3ddf9492a15002917bad4a6b72fd0bbec804e40adc12d9e9736730
|
4
|
+
data.tar.gz: fb5d4f8224dd483d1dc6730fd4f9be2145aee5b3f0a560790524fa53a4a0882d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 855889a02269799b938d12af331850b8fa1f3e19a9f2ef912f46c04690a26e1160761ee85195538b82e26c383fb1c7a95cd565bf8bc5510d83db056a5e830b9e
|
7
|
+
data.tar.gz: 4991776fa6b3ab42143f4e627e3c33a519a9fe099f9cf8c51b51931160214fd8f044352dff9cd62421e781ae43c90ade0a7330fa484f4f3d218137ebe16df098
|
@@ -36,6 +36,17 @@ module PrettyMultitask
|
|
36
36
|
|
37
37
|
t_out = consume_and_print slave, out, name, false
|
38
38
|
t_err = consume_and_print err_read, out, name, true
|
39
|
+
|
40
|
+
chars = []
|
41
|
+
t = Thread.new do
|
42
|
+
sleep 0.1 until r.ready?
|
43
|
+
(1..3).each do
|
44
|
+
chars << r.getc while r.ready?
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
Process.wait pid
|
49
|
+
Timeout.timeout(1) { t.join }
|
39
50
|
|
40
51
|
%i[slave err_read].each do |e|
|
41
52
|
loop { break unless binding.local_variable_get(e).ready? }
|
@@ -51,14 +62,6 @@ module PrettyMultitask
|
|
51
62
|
|
52
63
|
%i[master slave err_read err_write].each { |e| binding.local_variable_get(e).close }
|
53
64
|
|
54
|
-
chars = []
|
55
|
-
t = Thread.new do
|
56
|
-
sleep 0.1 until r.ready?
|
57
|
-
chars << r.getc while r.ready?
|
58
|
-
end
|
59
|
-
|
60
|
-
Process.wait pid
|
61
|
-
Timeout.timeout(1) { t.join }
|
62
65
|
|
63
66
|
result = Marshal.load(chars.join)
|
64
67
|
raise result[:error] if result[:error]
|
data/lib/pretty_multitask.rb
CHANGED