long-command-runner 0.0.2 → 0.1.0

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: 06a7cff41ee0361f61cc0ba29d9b4d5d162a5fe6099bd97ccc7b57a3120e7c33
4
- data.tar.gz: 1ee76174620253f38a8381c061c8687c76377e3267b5881e809cc5470dbb2114
3
+ metadata.gz: b58cdc805d08c5b444d626a401039c17f29bed21a8a84e6355768a22d8c0ab49
4
+ data.tar.gz: 4c0388e03084edd23bff68ee44e3e51be53953049ee6683bb9b9dd2a60baf062
5
5
  SHA512:
6
- metadata.gz: 587d93c530e828e990efd1ba4d64e3ffcc590d80f0fd73a0aa08aec424e67b3800c7c0737c3f90d9301e0b923eeb5e16ac093cdf5595e1210bc6315833a6ae25
7
- data.tar.gz: 19e0bf2c8d2e4b7914db77fc8d0cda3afbe0371e83dedeb89857140765b57e1b6eb43f03c3b2ab0d74455551ca059511f869f2873d2c0b698bc2fc3f8272e824
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
- puts "Program is at: #{runner.progress} %"
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
- - [The documentation]()
29
- - [The coverage]()
30
- - [The code quality report]()
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.
@@ -2,5 +2,5 @@
2
2
 
3
3
  module LCR
4
4
  # Version of the library.
5
- VERSION = '0.0.2'
5
+ VERSION = '0.1.0'
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: long-command-runner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roland Laurès