pretty_multitask 0.1.14 → 0.1.15
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.
- checksums.yaml +4 -4
- data/lib/pretty_multitask/run_callable.rb +9 -7
- data/lib/pretty_multitask/version.rb +1 -1
- metadata +3 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5a34f7f0e4eb43047bef13821611cab3f100478e3c3eeec474f534efb74e24fb
|
|
4
|
+
data.tar.gz: 891b3c8b1a38b8073ad4dd345b2178bd8ef053e08ae7644f77728f6bb76bb4d6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4490a69312060f7e7f895ac4969cecfdd1ccee75768e2fe2a5b998c2090d53a6f6bbb5d7e7d4e992c675d70da2630ba5a6bbfc575419303955c325e7813f501b
|
|
7
|
+
data.tar.gz: 8432471383fa2f0153b1bdf5d861af192578bb1073a020f2e8eea61ce1adb1078084514947e157df4c1e8ccb311aa5331c61c09696a4512d6ef12ecdd9c8612f
|
|
@@ -14,27 +14,28 @@ module PrettyMultitask
|
|
|
14
14
|
name = opts[:name]
|
|
15
15
|
out = STDOUT
|
|
16
16
|
@padding = opts[:padding]
|
|
17
|
-
master, slave = PTY.open
|
|
18
|
-
err_read, err_write = IO.pipe
|
|
19
17
|
|
|
18
|
+
|
|
19
|
+
master_out, slave_out = PTY.open
|
|
20
|
+
master_err, slave_err = PTY.open
|
|
20
21
|
r, w = UNIXSocket.pair(:STREAM, 0)
|
|
22
|
+
pid = run_on_fork(cmd, slave_err, slave_out, w)
|
|
21
23
|
|
|
22
|
-
pid = run_on_fork(cmd, err_write, slave, w)
|
|
23
24
|
Trapper.trap pid
|
|
24
25
|
|
|
25
|
-
t_out = consume_and_print
|
|
26
|
-
t_err = consume_and_print
|
|
26
|
+
t_out = consume_and_print master_out, out, name, false
|
|
27
|
+
t_err = consume_and_print master_err, out, name, true
|
|
27
28
|
|
|
28
29
|
chars = []
|
|
29
30
|
t = consume_and_store r, chars
|
|
30
31
|
|
|
31
32
|
Process.wait pid
|
|
32
33
|
|
|
33
|
-
wait_until_streams_are_ready [
|
|
34
|
+
wait_until_streams_are_ready [slave_out, slave_err]
|
|
34
35
|
|
|
35
36
|
join_threads [t_out, t_err, t]
|
|
36
37
|
|
|
37
|
-
close_streams [
|
|
38
|
+
close_streams [master_out, slave_out, master_err, slave_err]
|
|
38
39
|
|
|
39
40
|
result = Marshal.load(chars.join)
|
|
40
41
|
raise result[:error] if result[:error]
|
|
@@ -76,6 +77,7 @@ module PrettyMultitask
|
|
|
76
77
|
pid = fork do
|
|
77
78
|
STDERR.reopen err_w
|
|
78
79
|
STDOUT.reopen out_w
|
|
80
|
+
|
|
79
81
|
begin
|
|
80
82
|
result = cmd.call
|
|
81
83
|
obj = { result: result, error: nil }
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: pretty_multitask
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.15
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tiago Lopo Da Silva
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 2025-11-27 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: tlopo-executor
|
|
@@ -108,7 +107,6 @@ homepage: https://github.com/tlopo-ruby/tlopo-executor
|
|
|
108
107
|
licenses:
|
|
109
108
|
- MIT
|
|
110
109
|
metadata: {}
|
|
111
|
-
post_install_message:
|
|
112
110
|
rdoc_options: []
|
|
113
111
|
require_paths:
|
|
114
112
|
- lib
|
|
@@ -123,8 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
123
121
|
- !ruby/object:Gem::Version
|
|
124
122
|
version: '0'
|
|
125
123
|
requirements: []
|
|
126
|
-
rubygems_version: 3.
|
|
127
|
-
signing_key:
|
|
124
|
+
rubygems_version: 3.6.2
|
|
128
125
|
specification_version: 4
|
|
129
126
|
summary: Multitask with pretty output for Rake
|
|
130
127
|
test_files: []
|