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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 015cbac59f4b5483310082114036aba224b33d71
4
- data.tar.gz: a46a875e6f3a89771b18c3c55ecab921036e1318
3
+ metadata.gz: abaf52298bab64d4d610fd898c8595bbbfe9b3a7
4
+ data.tar.gz: 5d9cbd52b722d5fcca21de5756ab67214f3be3ca
5
5
  SHA512:
6
- metadata.gz: 622776ff057643462f4a635ae6420fb3f4d1394337801c1c05f78efa1f715b8ba17e5eb946a971d2f8ad46b5201730e39726581d1a8eaacb1351d084d93742c6
7
- data.tar.gz: 8830062712bd2ab7eac8a2b5d0f3bd4eaf5b91637796f991c05453ab0738b6f744a2309cb2f25d08342d25caa6a66acaca3a4218162fd8fc9d038c9fbbb2b372
6
+ metadata.gz: e3c8314db1c8d18514d07d233c9e30d61b35412f662dea3b83607c3c4c3af3fdbd5a97dfbb874dbc7df4f9e4928b7cededa19b1ad1d46724547a650fb2abd603
7
+ data.tar.gz: 384a910b71555021718514d492cf185057d23e0120ce40c9abacdaf790ad0a1d3a4f30a6e7b78cdd0ead4d49d4e28f600b89fa064001601d258e54573d7dbe90
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shexecutor (0.0.17)
4
+ shexecutor (0.0.19)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
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
- Remember to call iut.flush in order to stream stdout and stderr to the Executor object.
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'`)
@@ -1,3 +1,3 @@
1
1
  module SHExecutor
2
- VERSION = "0.0.19"
2
+ VERSION = "0.0.20"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shexecutor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.19
4
+ version: 0.0.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ernst van Graan