consoler 1.2.1 → 1.3.0

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
  SHA256:
3
- metadata.gz: 924c498b6db12469aef2fb31bbe7cc0bbcaa0e10cccb2a18b91584484b3cb189
4
- data.tar.gz: f99cdb84ac04f1ce5baa60ce29ccd7667a5239c0b959b1310ce8f8a9da4292a9
3
+ metadata.gz: 4ce3b8eca4b35ef9a82bb1ac0886aae0f49614dca29721c06e20bb94fdfc3d3b
4
+ data.tar.gz: addc213497a379b6d68fe844df9374bb93c48bb38ac40e7174343a50463e6a5a
5
5
  SHA512:
6
- metadata.gz: 20ff199169e12d2bff2be0d12b3bcb6e615eb5613166406c4e46963e6716fd9b70306f7b6f561525f0783866f6d8e0d4c7315b73f98150d2133bccf4a643bc48
7
- data.tar.gz: 34fb00e04d57de3fbcfc0b8242d01f5a76010860cac2fc78a69622ee3c7c89eb656a3f6d0abe05a7c38bdf71b97a97871c6738e488d52be203c5a2cc8bb603d4
6
+ metadata.gz: 15b94900e561a891e02f88d57f43b0614abb76b6ed75e59810d5a1ded0945874e71e1ceafacc320fd725be1ad470895bfc912f7f853601c45ce0ffc374ffd8a7
7
+ data.tar.gz: 0305b071d1b40ebd593d0cd81795787898d9081e2cbebee5636b406136ecbb325facade699426202e18bb6e4a39fc20c6760d3b18a90af33cb308e3d1141b4e2
data/README.md CHANGED
@@ -55,20 +55,20 @@ gem install consoler
55
55
  or add to your `Gemfile` for applications
56
56
 
57
57
  ```ruby
58
- gem 'consoler', '~> 1.2.1'
58
+ gem 'consoler', '~> 1.3.0'
59
59
  ```
60
60
 
61
61
  or to your `.gemspec` file for gems
62
62
 
63
63
  ```ruby
64
64
  Gem::Specification.new do |spec|
65
- spec.add_dependency 'consoler', '~> 1.2.1'
65
+ spec.add_dependency 'consoler', '~> 1.3.0'
66
66
  end
67
67
  ```
68
68
 
69
69
  ## Docs
70
70
 
71
- Full API documentation can the found here: https://www.rubydoc.info/gems/consoler/1.2.1
71
+ Full API documentation can the found here: https://www.rubydoc.info/gems/consoler/1.3.0
72
72
 
73
73
  ### API
74
74
 
@@ -27,8 +27,14 @@ module Consoler
27
27
  #
28
28
  # @param options [Hash] Options for the application
29
29
  # @option options [String] :description The description for the application (optional)
30
+ # @option options [bool] :rescue_errors Should the application catch errors (optional)
30
31
  def initialize(options = {})
31
32
  @description = options[:description]
33
+ @rescue_errors = if !options[:rescue_errors].nil? then
34
+ options[:rescue_errors]
35
+ else
36
+ true
37
+ end
32
38
  @commands = []
33
39
  end
34
40
 
@@ -92,6 +98,13 @@ module Consoler
92
98
  end
93
99
 
94
100
  result
101
+ rescue RuntimeError => e
102
+ if @rescue_errors
103
+ $stderr.puts "A runtime error occured: #{e.message.strip}"
104
+ nil
105
+ else
106
+ raise e
107
+ end
95
108
  end
96
109
 
97
110
  # Show the usage message
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Consoler
4
4
  # Current version number
5
- VERSION = '1.2.1'.freeze
5
+ VERSION = '1.3.0'.freeze
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: consoler
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-30 00:00:00.000000000 Z
11
+ date: 2021-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -109,7 +109,7 @@ licenses:
109
109
  - MIT
110
110
  metadata:
111
111
  yard.run: yri
112
- post_install_message:
112
+ post_install_message:
113
113
  rdoc_options: []
114
114
  require_paths:
115
115
  - lib
@@ -124,8 +124,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
124
  - !ruby/object:Gem::Version
125
125
  version: '0'
126
126
  requirements: []
127
- rubygems_version: 3.1.2
128
- signing_key:
127
+ rubygems_version: 3.2.15
128
+ signing_key:
129
129
  specification_version: 4
130
130
  summary: Consoler
131
131
  test_files: []