shexecutor 0.0.19 → 0.0.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +19 -3
- data/lib/shexecutor/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: abaf52298bab64d4d610fd898c8595bbbfe9b3a7
|
4
|
+
data.tar.gz: 5d9cbd52b722d5fcca21de5756ab67214f3be3ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3c8314db1c8d18514d07d233c9e30d61b35412f662dea3b83607c3c4c3af3fdbd5a97dfbb874dbc7df4f9e4928b7cededa19b1ad1d46724547a650fb2abd603
|
7
|
+
data.tar.gz: 384a910b71555021718514d492cf185057d23e0120ce40c9abacdaf790ad0a1d3a4f30a6e7b78cdd0ead4d49d4e28f600b89fa064001601d258e54573d7dbe90
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -11,6 +11,7 @@ SHExecutor is a convenience wrapper for executing shell commands from with-in a
|
|
11
11
|
|
12
12
|
## It does not support:
|
13
13
|
- streaming input to stdin
|
14
|
+
- being nested in an outer Timeout (see 'complications' below)
|
14
15
|
|
15
16
|
## For any executor:
|
16
17
|
- you can ask status, which will tell you "not executed", current status (e.g. run or sleep) and "no longer executing"
|
@@ -139,7 +140,24 @@ puts iut.stdout
|
|
139
140
|
puts iut.stderr
|
140
141
|
```
|
141
142
|
|
142
|
-
|
143
|
+
## Complications
|
144
|
+
Remember to call iut.flush in order to access stdout and stderr in the Executor object.
|
145
|
+
|
146
|
+
Nested timeouts can result in complications. Because Executor drains stdout and stderr to avoid dead-locking, these StringIO streams will raise an IOError if they are interrupted. The backtrace of these IOErrors will not contain information of an outer Timeout or other exception that interrupted the Executor. The code below illustrates the complication:
|
147
|
+
|
148
|
+
```
|
149
|
+
def shexecutor_complication
|
150
|
+
result, stdout, stderr = ::SHExecutor::execute_and_timeout_after("/bin/sleep", "30", 20)
|
151
|
+
end
|
152
|
+
|
153
|
+
Timeout::timeout(5) do
|
154
|
+
shexecutor_complication
|
155
|
+
end
|
156
|
+
|
157
|
+
# shexecutor.rb:in 'copy_stream': stream closed (IOError)
|
158
|
+
```
|
159
|
+
|
160
|
+
## Contributing
|
143
161
|
|
144
162
|
Please send feedback and comments to the author at:
|
145
163
|
|
@@ -147,8 +165,6 @@ puts iut.stderr
|
|
147
165
|
|
148
166
|
Thanks to Sheldon Hearn for review and great ideas that unblocked complex challenges (https://rubygems.org/profiles/sheldonh).
|
149
167
|
|
150
|
-
## Contributing
|
151
|
-
|
152
168
|
1. Fork it ( https://github.com/[my-github-username]/executor/fork )
|
153
169
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
154
170
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
data/lib/shexecutor/version.rb
CHANGED