shexecutor 0.0.17 → 0.0.18
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/lib/shexecutor/version.rb +1 -1
- data/lib/shexecutor.rb +0 -14
- 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: 73745b3ef935c240d5712f017bc70c715db4d83f
|
4
|
+
data.tar.gz: 07e45a49417e94d555bc106f5563c6caa787990f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5231082615df9d74fd8d9d6401767452420ef4da0e3fd9f459dde7bafcc6f0b32c524020e9344a419a021e7b402e3259c764d653da87fa401caf2c170b5419cc
|
7
|
+
data.tar.gz: 8665e98795b34ca56140ab4e6f490e850fada417a200dcba509d0fb090d20e8b5f86f67329915d0a871df1fa6e9956dd35b935a48e9d2e3b4fbab4ea092ce5ec
|
data/lib/shexecutor/version.rb
CHANGED
data/lib/shexecutor.rb
CHANGED
@@ -113,11 +113,8 @@ module SHExecutor
|
|
113
113
|
end
|
114
114
|
end
|
115
115
|
|
116
|
-
# Warning! This method will block if you are not blocking!
|
117
|
-
# Check status? before calling this to see if the process has completed if you do not want to block
|
118
116
|
def flush
|
119
117
|
return nil if @data_out.nil? or @data_err.nil?
|
120
|
-
#store output for inspection
|
121
118
|
stdout_data = @data_out.string
|
122
119
|
stderr_data = @data_err.string
|
123
120
|
@stdout = stdout_data if stdout_data != ""
|
@@ -158,7 +155,6 @@ module SHExecutor
|
|
158
155
|
@t0 = nil
|
159
156
|
Open3::popen3(application_path, options) do |stdin, stdout, stderr, thr|
|
160
157
|
@t0 = thr
|
161
|
-
# read stderr and stdout into buffers to prevent blocking
|
162
158
|
t1 = Thread.new do
|
163
159
|
begin
|
164
160
|
IO.copy_stream(stdout, data_out)
|
@@ -177,9 +173,6 @@ module SHExecutor
|
|
177
173
|
end
|
178
174
|
m = Mutex.new
|
179
175
|
done = false
|
180
|
-
# track timeout if required. Do this ourselves since the mechanism
|
181
|
-
# is simple and Timeout struggles from multi-threading issues.
|
182
|
-
# IO.copy_stream stop the Timeout exception from being thrown properly.
|
183
176
|
timedout = false
|
184
177
|
t3 = Thread.new do
|
185
178
|
count = 0
|
@@ -253,13 +246,6 @@ module SHExecutor
|
|
253
246
|
end
|
254
247
|
end
|
255
248
|
|
256
|
-
def kill_9_process(pid)
|
257
|
-
return if pid.nil?
|
258
|
-
Process.kill(9, pid)
|
259
|
-
rescue Errno::ESRCH
|
260
|
-
#done
|
261
|
-
end
|
262
|
-
|
263
249
|
def kill_process(pid)
|
264
250
|
return if pid.nil?
|
265
251
|
Process.kill("TERM", pid)
|