long-command-runner 0.0.2 → 0.1.0
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/README.md +6 -4
- data/lib/long-command-runner/line_reader.rb +7 -0
- data/lib/long-command-runner/runner.rb +4 -1
- data/lib/long-command-runner/version.rb +1 -1
- 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: b58cdc805d08c5b444d626a401039c17f29bed21a8a84e6355768a22d8c0ab49
|
4
|
+
data.tar.gz: 4c0388e03084edd23bff68ee44e3e51be53953049ee6683bb9b9dd2a60baf062
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c940d567c3b55d8ed5d81c042d9afbc0536d7ad3f986ba6bf9424e7473a5408ef562798e78de845140cccb4dd65434363a524f928fbab7ae58edc41e893e01e
|
7
|
+
data.tar.gz: 5588ed15d88d98cb1cb0e2dd8871889ef06d62f98a932e9a50333130cc10efc9c38ef1ea5368a19a535bab1a493af6530f68d2640a5bb71c91e4f137908fcddd
|
data/README.md
CHANGED
@@ -17,7 +17,8 @@ runner.launch
|
|
17
17
|
# command now runs
|
18
18
|
|
19
19
|
while runner.running?
|
20
|
-
|
20
|
+
STDOUT.write "\rProgram is at: #{runner.progress} % \r"
|
21
|
+
STDOUT.flush
|
21
22
|
end
|
22
23
|
puts 'program ended !'
|
23
24
|
```
|
@@ -25,6 +26,7 @@ puts 'program ended !'
|
|
25
26
|
# documentation
|
26
27
|
|
27
28
|
Here some links:
|
28
|
-
|
29
|
-
- [The
|
30
|
-
- [The
|
29
|
+
|
30
|
+
- [The documentation](https://rol_public.gitlab.io/long-command-runner/master/)
|
31
|
+
- [The coverage](https://rol_public.gitlab.io/long-command-runner/master/coverage)
|
32
|
+
- [The code quality report](https://rol_public.gitlab.io/long-command-runner/master/rubycritic/overview.html)
|
@@ -28,6 +28,13 @@ module LCR
|
|
28
28
|
@on_input = on_input
|
29
29
|
end
|
30
30
|
|
31
|
+
# access to the array of streams.
|
32
|
+
# The intance variable is duplicated to prevent modification of the array.
|
33
|
+
# @return [Array<IO>]
|
34
|
+
def streams
|
35
|
+
@streams.dup
|
36
|
+
end
|
37
|
+
|
31
38
|
# Blocking method to read on the streams (you may call it in a dedicated thread).
|
32
39
|
#
|
33
40
|
# It will stop when eof is reach. Never the less it may not be the end.
|
@@ -60,6 +60,7 @@ module LCR
|
|
60
60
|
on_newline(*new_lines)
|
61
61
|
end
|
62
62
|
@reader_thr = Thread.new { @line_reader.read }
|
63
|
+
stderr_in.close
|
63
64
|
Thread.pass
|
64
65
|
end
|
65
66
|
|
@@ -95,7 +96,9 @@ module LCR
|
|
95
96
|
#
|
96
97
|
# @return [Process::Status]
|
97
98
|
def wait
|
98
|
-
@container.wait
|
99
|
+
p = @container.wait
|
100
|
+
sleep 0.01 until @line_reader.streams.all?(&:eof?)
|
101
|
+
p
|
99
102
|
end
|
100
103
|
|
101
104
|
# Get the status of the process without blocking.
|