kommando 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/examples/kill.rb +3 -1
- data/lib/kommando.rb +13 -0
- data/lib/kommando/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: 1eb976e3f92e3f6f40a3ec40c23e066fc1caaca5
|
4
|
+
data.tar.gz: 8d8db58bca29f0f3c05f85f7f7c239130a02a810
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b1db26c6871afc3450b3a7d7744569a42f2eb4762de02edf21c1a75f9d42cbd1862d0a909dee2cdf76f228123356981448af5240d680fb2aa5ce181fba51aa8
|
7
|
+
data.tar.gz: 176e6c683af1f6d3418584279b520ace53e4482e6527e21f014a1e0ccffde507357f426c84d3d6817e2a788258abf07d8717b700ac87c03ee6e69403f805ad03
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## 0.0.8
|
4
|
+
Improves killing, tries to fix Linux specific issues.
|
5
|
+
|
6
|
+
- FIX: Killed process has status code 137.
|
7
|
+
- MAYBEFIX: Linux: undefined method `exitstatus' for nil:NilClass (NoMethodError)`
|
8
|
+
|
3
9
|
## 0.0.7
|
4
10
|
Async running, killing the run.
|
5
11
|
|
data/examples/kill.rb
CHANGED
data/lib/kommando.rb
CHANGED
@@ -22,6 +22,7 @@ class Kommando
|
|
22
22
|
opts[:timeout].to_f
|
23
23
|
end
|
24
24
|
@timeout_happened = false
|
25
|
+
@kill_happened = false
|
25
26
|
|
26
27
|
@code = nil
|
27
28
|
@executed = false
|
@@ -40,6 +41,7 @@ class Kommando
|
|
40
41
|
|
41
42
|
def kill
|
42
43
|
Process.kill('KILL', @pid)
|
44
|
+
@kill_happened = true
|
43
45
|
end
|
44
46
|
|
45
47
|
def run
|
@@ -104,7 +106,18 @@ class Kommando
|
|
104
106
|
|
105
107
|
@code = if @timeout_happened
|
106
108
|
1
|
109
|
+
elsif @kill_happened
|
110
|
+
137
|
107
111
|
else
|
112
|
+
unless $?
|
113
|
+
begin
|
114
|
+
Timeout.timeout(0.1) do
|
115
|
+
Process.wait #WIP: trying to fix weird linux stuff when $? is nil
|
116
|
+
end
|
117
|
+
rescue Timeout::Error
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
108
121
|
$?.exitstatus
|
109
122
|
end
|
110
123
|
rescue RuntimeError => ex
|
data/lib/kommando/version.rb
CHANGED