execute 0.1.38 → 0.1.39
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cmd.rb +3 -3
- data/lib/timeout_error.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: 38fb4647be1c94c5513f80514adde8b97b618eb9
|
4
|
+
data.tar.gz: 02125021c9178df1f7c4944abdee1cd64c77b19e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f85781a0f832f5bdb25cf4e880dcb659725fd826b1e1d74ca8f32f92a35d47a36212c11bbea3296eb08b9554245a4d567051d591713e11250266285aa4b19995
|
7
|
+
data.tar.gz: 13d94191b6c1cb315871be2a637b0b9a18847e46947a17ce1d4f0e12f48c409df4e298e97cde22a6e12e6facb931303010a4d484bdbfdf13f9caa31f8f9f65b3
|
data/lib/cmd.rb
CHANGED
@@ -38,14 +38,13 @@ class CMD < Hash
|
|
38
38
|
puts "exit_code: #{self[:exit_code]}"
|
39
39
|
end
|
40
40
|
|
41
|
+
raise TimeoutError.new(self[:command], self[:timeout]) if(key?(:timed_out))
|
41
42
|
if((self[:exit_code] != 0) && !self[:ignore_exit_code])
|
42
43
|
exception_text = "Exit code: #{self[:exit_code]}"
|
43
44
|
exception_text = "#{exception_text}\nError: '#{self[:error]}'"
|
44
45
|
exception_text = "#{exception_text}\nOutput: '#{self[:output]}'"
|
45
46
|
raise StandardError.new(exception_text)
|
46
47
|
end
|
47
|
-
|
48
|
-
raise TimedOutError.new(self[:command], self[:timeout]) if(key?(:timed_out))
|
49
48
|
end
|
50
49
|
|
51
50
|
def system
|
@@ -65,7 +64,8 @@ class CMD < Hash
|
|
65
64
|
sleep(0.1)
|
66
65
|
if((Time.now - start_time).to_f > self[:timeout])
|
67
66
|
self[:timed_out] = true
|
68
|
-
wait_thr.
|
67
|
+
Process.kill('KILL',wait_thr.pid)
|
68
|
+
sleep(0.1)
|
69
69
|
end
|
70
70
|
end
|
71
71
|
end
|
data/lib/timeout_error.rb
CHANGED