pretty_multitask 0.1.4 → 0.1.5

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: 6892e4801fcb0acf2573634a7a60351721529a14059005a0ba1c4628351622b6
4
- data.tar.gz: 3f1e010533490768951b4badcd44869398c640f16722c3020aa595733d76ca77
3
+ metadata.gz: c87f12464064816aeeca47d2f9e5168a184299a9e71583a9b718ffdb2821a365
4
+ data.tar.gz: 4516ed4cfcb98738e840868a9688f44785398e67d48f979ba9195731c59347ec
5
5
  SHA512:
6
- metadata.gz: 99c9ce3d7c641820f5e84530cb1c9f9ce111c38bcd1da7cd9239dc77a59c4c5b6b76a910a9f4ac0ceb26f68629bf9ac3ab38808cd12030a5cf7544cac09edaf1
7
- data.tar.gz: '015947fdd16c4a74fab04378cd7ac3aded372ef1c9e7c9948f9a17a5247eb34e4f99fbeda49696f5b35c251f8b9206ad5969a600baacd2dc49b266530b8023de'
6
+ metadata.gz: 9e5a3357f92557477761e6175e4ffe97c9470aa3c20247647879f3acb8981cb0b6dc885adf36610a6f012658a80d19c341acbc30e28a638133b2b4b803afd683
7
+ data.tar.gz: bc62a7f8b16e85cbfd984b047e4c4ae28f932ced4fbd74507b2bb73794e11e0eef07577038ab4943eca66f41f469caeed896f66d927f4ac73972ff1b0c1b7999
@@ -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"
@@ -37,8 +37,6 @@ module PrettyMultitask
37
37
  t_out = consume_and_print slave, out, name, false
38
38
  t_err = consume_and_print err_read, out, name, true
39
39
 
40
- Process.wait pid
41
-
42
40
  %i[slave err_read].each do |e|
43
41
  loop { break unless binding.local_variable_get(e).ready? }
44
42
  end
@@ -54,8 +52,15 @@ module PrettyMultitask
54
52
  %i[master slave err_read err_write].each { |e| binding.local_variable_get(e).close }
55
53
 
56
54
  chars = []
57
- chars << r.getc while r.ready?
58
- r.close
55
+ t = Thread.new do
56
+ sleep 0.1 until r.ready?
57
+ (1..3).each do
58
+ chars << r.getc while r.ready?
59
+ end
60
+ end
61
+
62
+ Process.wait pid
63
+ Timeout.timeout(1) { t.join }
59
64
 
60
65
  result = Marshal.load(chars.join)
61
66
  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.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pretty_multitask
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tiago Lopo Da Silva
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-03-30 00:00:00.000000000 Z
11
+ date: 2020-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tlopo-executor