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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f89845bbcbcee9e9914a0a3107ea41866183f4276dc2aaf0f2ebab16c166b7b6
4
- data.tar.gz: f154a0b734e97ce7ca92ffa81a33ac3391cbe39529c7e713127fbe2b447a789a
3
+ metadata.gz: 855e2f7b1a3ddf9492a15002917bad4a6b72fd0bbec804e40adc12d9e9736730
4
+ data.tar.gz: fb5d4f8224dd483d1dc6730fd4f9be2145aee5b3f0a560790524fa53a4a0882d
5
5
  SHA512:
6
- metadata.gz: fdc1274cadfce484efde26c43cf6735f856273fc10c5d1ae9f0aed90427e191702613b5ab5d2344f183b7862229a2ac8490b09284e12730634b83c9305e5e90a
7
- data.tar.gz: 29f8a24249f62371c325fe9bc9c4e7397c7c38487891fbcbeda59be6ac8efeba3d150f2189afc147fab99fd6e85c817762a472e634148241a8fb80ec4c80e833
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]
@@ -7,6 +7,7 @@ module PrettyMultitask
7
7
  @jobs.each do |j|
8
8
  [:name, :cmd ].each {|o| raise "#{o} must be specified for job #{j}" unless j[o] }
9
9
  j[:out_file] = "/tmp/#{j[:name]}-#{Time.now.strftime('%s.%N')}"
10
+ FileUtils.touch j[:out_file]
10
11
  end
11
12
  end
12
13
 
@@ -1,3 +1,3 @@
1
1
  module PrettyMultitask
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
@@ -7,6 +7,7 @@ require 'io/wait'
7
7
  require 'socket'
8
8
  require 'timeout'
9
9
  require 'yaml'
10
+ require 'fileutils'
10
11
 
11
12
  module PrettyMultitask
12
13
  require "#{__dir__}/pretty_multitask/color"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pretty_multitask
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tiago Lopo Da Silva