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 +4 -4
- data/README.md +3 -3
- data/lib/consoler/application.rb +13 -0
- data/lib/consoler/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ce3b8eca4b35ef9a82bb1ac0886aae0f49614dca29721c06e20bb94fdfc3d3b
|
4
|
+
data.tar.gz: addc213497a379b6d68fe844df9374bb93c48bb38ac40e7174343a50463e6a5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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.
|
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.
|
71
|
+
Full API documentation can the found here: https://www.rubydoc.info/gems/consoler/1.3.0
|
72
72
|
|
73
73
|
### API
|
74
74
|
|
data/lib/consoler/application.rb
CHANGED
@@ -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
|
data/lib/consoler/version.rb
CHANGED
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.
|
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:
|
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.
|
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: []
|