process_handler 0.2.5 → 0.2.7

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: a4a14c7d614a871238307ceaac0d848f7382e062
4
- data.tar.gz: cc7f04011bc415c718133b26337302b69eb5eb91
3
+ metadata.gz: 9fae6b203d33d287f1159634365e53eb1eef474c
4
+ data.tar.gz: 9a6899a92bb855415d24929630090ca3b60c5eee
5
5
  SHA512:
6
- metadata.gz: 8896165a6cef006bdf08e014fb95d0e070320b39309ed1d40728a8450518542b266fe4df1e982dbe64efddf99327d45baaccaa5981477c775c9a47183a78023e
7
- data.tar.gz: 541d97b93c9fcb633440e05d725489f33321eb034e13a4e8aa12567ee593335279048b3d23177bb69b295cbc9de1a12faf9af1bf93c1a7763a9be512d25dfe4c
6
+ metadata.gz: 62ac732af5b75b5958a0ac1ba18297fbf6fa2abdda74615d7f1b99db50c5b2679ab37e8a5f548f7be232597a211c2b6a2e8c2d613c96d11c1b0ed0e5702e0e06
7
+ data.tar.gz: 3cbbcebd3106fbb0e079679fdb51f7486105c980115f6c7a8b01014a345bd7aada691654c157f01e96da7780e8a07c2338b4f2aaa1c5ff53d94bf4f4e5b89618
@@ -39,7 +39,7 @@ module Salemove
39
39
  end
40
40
  end
41
41
 
42
- # Interrupts a process. (The default action is to terminate gracefully).
42
+ # Terminates the process gracefully
43
43
  def init_int_signal
44
44
  trap :INT do
45
45
  puts 'Exiting process gracefully!'
@@ -47,10 +47,11 @@ module Salemove
47
47
  end
48
48
  end
49
49
 
50
- # Terminates a process immediately.
50
+ # Terminates the process gracefully
51
51
  def init_term_signal
52
52
  trap :TERM do
53
- exit
53
+ puts 'Exiting process gracefully!'
54
+ stop
54
55
  end
55
56
  end
56
57
 
@@ -1,5 +1,5 @@
1
1
  module Salemove
2
2
  module ProcessHandler
3
- VERSION = '0.2.5'
3
+ VERSION = '0.2.7'
4
4
  end
5
5
  end
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_dependency 'airbrake'
21
+ spec.add_dependency 'airbrake', '~> 4.3'
22
22
  spec.add_dependency 'sucker_punch', '~> 1.1' # for async airbrake notifications
23
23
  spec.add_dependency 'growl'
24
24
  spec.add_dependency 'terminal-notifier'
@@ -3,14 +3,14 @@ require 'salemove/process_handler/composite_process'
3
3
 
4
4
  describe ProcessHandler::CompositeProcess do
5
5
 
6
- it 'can be gracefully stopped' do
6
+ it 'can be gracefully stopped with SIGINT' do
7
7
  result = run_and_signal_fixture(fixture: 'composite_service.rb', signal: 'INT', sleep_period: 1)
8
8
  expect(result).to eq("RESULT\nExiting process gracefully!\n")
9
9
  end
10
10
 
11
- it 'can be terminated' do
11
+ it 'can be gracefully stopped with SIGTERM' do
12
12
  result = run_and_signal_fixture(fixture: 'composite_service.rb', signal: 'TERM', sleep_period: 1)
13
- expect(result).to eq("RESULT\n")
13
+ expect(result).to eq("RESULT\nExiting process gracefully!\n")
14
14
  end
15
15
 
16
16
  end
@@ -31,14 +31,14 @@ describe ProcessHandler::CronProcess do
31
31
  end
32
32
  end
33
33
 
34
- it 'can be gracefully stopped' do
34
+ it 'can be gracefully stopped with SIGINT' do
35
35
  result = run_and_signal_fixture(fixture: 'cron_service.rb', signal: 'INT', sleep_period: 1)
36
36
  expect(result).to eq("RESULT\nExiting process gracefully!\n")
37
37
  end
38
38
 
39
- it 'can be terminated' do
39
+ it 'can be gracefully stopped with SIGTERM' do
40
40
  result = run_and_signal_fixture(fixture: 'cron_service.rb', signal: 'TERM', sleep_period: 1)
41
- expect(result).to eq("RESULT\n")
41
+ expect(result).to eq("RESULT\nExiting process gracefully!\n")
42
42
  end
43
43
 
44
44
  describe 'scheduler' do
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: process_handler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Indrek Juhkam
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-15 00:00:00.000000000 Z
11
+ date: 2016-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: airbrake
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: '4.3'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: '4.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: sucker_punch
29
29
  requirement: !ruby/object:Gem::Requirement