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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: acfba23f49067f3a5685780644f56fb5369e4836
4
- data.tar.gz: 4773b9387220563a69f13fb3f7c3e37a6c3c4639
3
+ metadata.gz: 1eb976e3f92e3f6f40a3ec40c23e066fc1caaca5
4
+ data.tar.gz: 8d8db58bca29f0f3c05f85f7f7c239130a02a810
5
5
  SHA512:
6
- metadata.gz: 40d0a3852ff6711cc36dbb422356f8c616f48348ce764a9ecc9d8cb781a528e456715545e089cd39f6ccde3b7b6823f9d36398398652fbeba02abae9db9ecfb5
7
- data.tar.gz: a9bae7941b46c95b7d167f8a6c94078927b7a5d51c1fca5c40a450c93d641e97533eca7270e4eab0adf45d395b9c4af43caf61f9b67392f4a036b356cfe00301
6
+ metadata.gz: 0b1db26c6871afc3450b3a7d7744569a42f2eb4762de02edf21c1a75f9d42cbd1862d0a909dee2cdf76f228123356981448af5240d680fb2aa5ce181fba51aa8
7
+ data.tar.gz: 176e6c683af1f6d3418584279b520ace53e4482e6527e21f014a1e0ccffde507357f426c84d3d6817e2a788258abf07d8717b700ac87c03ee6e69403f805ad03
@@ -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
 
@@ -10,4 +10,6 @@ Thread.new do
10
10
  end
11
11
  k.run
12
12
 
13
- puts "Killed while sleeping."
13
+ raise "not 137" unless k.code == 137
14
+
15
+ puts "Killed while sleeping, exitcode is 137"
@@ -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
@@ -1,3 +1,3 @@
1
1
  class Kommando
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kommando
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matti Paksula