frontkick 0.4.7 → 0.4.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: 3c05169903b48aeb4fd103f0f8eeac55b2c0b670
4
- data.tar.gz: fc7d0c173417b7f3f4c24b0551a35a3b43b7b534
3
+ metadata.gz: 3514cd020c4022cbe113d670b35b4a2b4112bf68
4
+ data.tar.gz: 53aa5b300c7c725ad9c00eebf94590c7aa048045
5
5
  SHA512:
6
- metadata.gz: ea20bd4b9dddee6bb5ab47f43c9334ec0d6ce1cde77a9b6660110ce32351a6bf31f699dd72e5d5d757baa964ff0483606082b61131762e489d0da6132f807963
7
- data.tar.gz: 3cd1984f02b98b548190c0a37843c2ceee42ee79ed89149f036f18f376f519c793fbcf0675c028c931b8c015e3883b411804d2a0751f00d2fe3cf8aa9e89782d
6
+ metadata.gz: 7a91a20a9782fe17a69b09ac0d3e1c09b1a2fa47bc0ce66b1d2498e5ad9fc44faa88e4b6694ad637deacb72d16a0e3cb9159a7bbd46f062c1709ed4e3666a84b
7
+ data.tar.gz: 630a6f90b0ce7d16f5d07b13e96b89928fe57ea90aecc766727a59279962919e49c1da6847b6d8e893068de43e9576dd98b99588d521b81629cb5f08e327a04e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ # 0.4.8 (2016/01/22)
2
+
3
+ Fixes:
4
+
5
+ - Fix kill_child option
6
+
1
7
  # 0.4.7 (2016/01/22)
2
8
 
3
9
  Enhancements:
data/Gemfile CHANGED
@@ -2,3 +2,5 @@
2
2
  source 'https://rubygems.org'
3
3
 
4
4
  gemspec
5
+ gem 'pry'
6
+ gem 'pry-nav'
data/README.md CHANGED
@@ -58,9 +58,10 @@ If you prefer to be blocked:
58
58
 
59
59
  On receiving INT and TERM signal, kill the kicked child process before exiting
60
60
 
61
- Frontkick.exec("sleep 100", :kill_child => true)
61
+ Frontkick.exec(["sleep 100"], :kill_child => true)
62
62
 
63
63
  NOTE: This uses Kernel.trap inside.
64
+ NOTE: Shoud use `[]` form, otherwirse `sh -c 'sleep 100'` is ran, and frotkick kills sh process, but sleep process remains
64
65
 
65
66
  ### Hint: Redirect stderr to stdout
66
67
 
@@ -27,17 +27,14 @@ module Frontkick
27
27
  stdin.close
28
28
  pid = wait_thr.pid
29
29
 
30
- trapped_signal = nil
31
30
  if opts[:kill_child]
32
- trap_signal(pid) {|sig| trapped_signal = sig }
31
+ trap_signal(pid)
33
32
  end
34
33
 
35
34
  stdout = out_reader.value
36
35
  stderr = err_reader.value
37
36
  exit_code = wait_thr.value.exitstatus
38
37
  process_wait(pid)
39
-
40
- exit_signal(trapped_signal) if trapped_signal
41
38
  end
42
39
  end
43
40
  rescue Frontkick::TimeoutLocal => e
@@ -60,23 +57,14 @@ module Frontkick
60
57
 
61
58
  def self.trap_signal(pid)
62
59
  trap :INT do
63
- Process.kill(:INT, pid)
64
- yield(:INT)
60
+ Process.kill(:TERM, pid)
61
+ process_wait(pid)
62
+ exit 130
65
63
  end
66
64
  trap :TERM do
67
65
  Process.kill(:TERM, pid)
68
- yield(:TERM)
69
- end
70
- end
71
-
72
- def self.exit_signal(signal)
73
- case signal
74
- when :INT
75
- exit(130)
76
- when :TERM
77
- exit(143)
78
- else
79
- raise 'Non supported signal'
66
+ process_wait(pid)
67
+ exit 143
80
68
  end
81
69
  end
82
70
 
@@ -1,3 +1,3 @@
1
1
  module Frontkick
2
- VERSION = "0.4.7"
2
+ VERSION = "0.4.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: frontkick
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.7
4
+ version: 0.4.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naotoshi Seo