bogo-cli 0.1.30 → 0.1.32

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: 27ac44bef0f44b0011ba4e7ff9655dc7136663d3
4
- data.tar.gz: d95aa8f4ea8d26c1c7844a244e21c8111dd29a1c
3
+ metadata.gz: d2540114ae7a14349139d252eb4ddd284c9f27ec
4
+ data.tar.gz: f4003172f6d8c64c87d72815ed41a6dc38af9e10
5
5
  SHA512:
6
- metadata.gz: 889a81584c08b412a83129df4c929507ab4ad13e569f815291afdd236a1e249ec7d63614137777b68081907714519e59fe174a08dc3822f71d49f25acef2ef62
7
- data.tar.gz: 25194e1255902b3d8d841da1389c04195594b0a0726f0d4525c9d3a7dc80f425a099140e36c25d1ad45390f458cd873c0a71f1554d8d6953a89ee9db68f7ba5e
6
+ metadata.gz: 261c852566e3588ee7907f2abc015fdb09cee304c7e7759d8541e1291035e2f52a6e9740c663f4183aa5bb3840d877671092eb1682d0e748736b974d39dd3532
7
+ data.tar.gz: 09cc190c1d47ce27ed762a908b8292dc555c609221156510b1d090e055c489640a6d2a5d7d27be545fe4135f815ab3db9a558e05cbc06132a9d9b04f0ca225ff
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## v0.1.32
2
+ * Run previous registered trap if provided
3
+ * Allow clean exit or exception raise in main thread on signal
4
+
1
5
  ## v0.1.30
2
6
  * Trap and shutdown on TERM signal (mimic INT behavior)
3
7
 
data/lib/bogo-cli.rb CHANGED
@@ -6,6 +6,11 @@ module Bogo
6
6
  module Cli
7
7
  autoload :Command, 'bogo-cli/command'
8
8
  autoload :Setup, 'bogo-cli/setup'
9
+
10
+ class << self
11
+ attr_accessor :exit_on_signal
12
+ end
13
+
9
14
  end
10
15
  end
11
16
 
@@ -1,6 +1,21 @@
1
1
  # Trigger shutdown on INT or TERM signals
2
- Signal.trap('INT'){ exit 0 }
3
- Signal.trap('TERM'){ exit 0 }
2
+ o_int = Signal.trap('INT'){
3
+ o_int.call if o_int.respond_to?(:call)
4
+ if(Bogo::Cli.exit_on_signal == false)
5
+ Thread.main.raise SignalException.new('SIGINT')
6
+ else
7
+ exit 0
8
+ end
9
+ }
10
+
11
+ o_term = Signal.trap('TERM'){
12
+ o_int.call if o_int.respond_to?(:call)
13
+ if(Bogo::Cli.exit_on_signal == false)
14
+ Thread.main.raise SignalException.new('SIGTERM')
15
+ else
16
+ exit 0
17
+ end
18
+ }
4
19
 
5
20
  require 'bogo-cli'
6
21
 
@@ -1,6 +1,6 @@
1
1
  module Bogo
2
2
  module Cli
3
3
  # Current library version
4
- VERSION = Gem::Version.new('0.1.30')
4
+ VERSION = Gem::Version.new('0.1.32')
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bogo-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.30
4
+ version: 0.1.32
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Roberts
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-01 00:00:00.000000000 Z
11
+ date: 2015-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bogo
@@ -101,9 +101,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
101
  version: '0'
102
102
  requirements: []
103
103
  rubyforge_project:
104
- rubygems_version: 2.2.2
104
+ rubygems_version: 2.4.8
105
105
  signing_key:
106
106
  specification_version: 4
107
107
  summary: CLI Helper libraries
108
108
  test_files: []
109
- has_rdoc: