maestro_shell 0.0.8 → 0.0.9
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 +2 -0
- data/lib/util/shell.rb +26 -7
- data/lib/util/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81ed4f0b65fb2d09a22195f1c5b27609b3cf35e8
|
4
|
+
data.tar.gz: 1808bd7d8e2de7ef9eced825e859dc7893134fa6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06664c62196f45e188d85ad45f704e4b57022cf4b7b17784e865e5c24e371d1952f52562d2b8a8c9b9123e258ec0186e6f7b4aed271e4ee841ffdff6537072ef
|
7
|
+
data.tar.gz: b613cafeac99c90522d9b3da1a4d50c2930686f27270312ce22896656b7e5a813f63005ff0f058fdbdf3e0baa3f1927086aab9007ddb9ff4b8279ce0c88ec49a
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
Maestro Shell Utility Gem
|
2
2
|
=========================
|
3
|
+
[](http://badge.fury.io/rb/maestro_shell)
|
4
|
+
[](https://codeclimate.com/github/maestrodev/maestro-shell)
|
3
5
|
|
4
6
|
Library For Executing Shell commands on Linux and Windows
|
5
7
|
=========================================================
|
data/lib/util/shell.rb
CHANGED
@@ -83,17 +83,36 @@ module Maestro
|
|
83
83
|
process.start
|
84
84
|
w.close
|
85
85
|
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
86
|
+
potential_eof = false
|
87
|
+
begin
|
88
|
+
loop {
|
89
|
+
text = r.read_nonblock(1024)
|
90
|
+
potential_eof = false
|
91
|
+
out_file.write(text)
|
92
|
+
|
93
|
+
if delegate && on_output
|
94
|
+
delegate.send(on_output, text)
|
95
|
+
end
|
96
|
+
}
|
97
|
+
rescue IO::WaitReadable => e
|
98
|
+
if !process.exited?
|
99
|
+
# process still running, block for input here to avoid a busy
|
100
|
+
# loop, but with a timeout in case the process exited with no
|
101
|
+
# further output
|
102
|
+
IO.select([r], nil, nil, 1)
|
103
|
+
retry
|
104
|
+
elsif !potential_eof
|
105
|
+
# process is done, but keep looping while there is input to
|
106
|
+
# read
|
107
|
+
potential_eof = true
|
108
|
+
retry
|
92
109
|
end
|
110
|
+
rescue EOFError
|
111
|
+
# expected when we reach end of output from the process
|
93
112
|
end
|
94
113
|
|
95
114
|
r.close
|
96
|
-
process.wait
|
115
|
+
process.wait unless process.exited?
|
97
116
|
@exit_code = ExitCode.new(process.exit_code)
|
98
117
|
end
|
99
118
|
|
data/lib/util/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: maestro_shell
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Doug Henderson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-10-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logging
|