cri 2.15.9 → 2.15.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +16 -14
- data/NEWS.md +54 -48
- data/lib/cri/command.rb +3 -3
- data/lib/cri/command_dsl.rb +6 -6
- data/lib/cri/help_renderer.rb +1 -1
- data/lib/cri/option_definition.rb +10 -10
- data/lib/cri/version.rb +1 -1
- data/test/test_command.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ac76773abd662b4cdd83c22ade38073436ae16afeef75ad95060578b71c23ea
|
4
|
+
data.tar.gz: 4386555ef8c6d3c27f77205120291efc1898be80973550a81271a89ddaef8495
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f096a5583428ecdca24ad0a800488cb07269d181bc853c6872d34caf7167b6d2d42fb0c2851da24eee4ed4fd1d0ed9e83aa2c75ed644275cb88ac081f0950ed7
|
7
|
+
data.tar.gz: 02645607f896fcc9ebf2f432d16f3b1b37f8688e4eca21d288bfa0e781c4e0cd2aa5125172ffde92fdec2a14f18220f93e454feb57449f88f7a95f1a0d2b9ef0
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
cri (2.15.
|
4
|
+
cri (2.15.10)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
@@ -14,22 +14,22 @@ GEM
|
|
14
14
|
thor (>= 0.19.4, < 2.0)
|
15
15
|
tins (~> 1.6)
|
16
16
|
docile (1.3.2)
|
17
|
-
jaro_winkler (1.5.
|
18
|
-
json (2.
|
17
|
+
jaro_winkler (1.5.4)
|
18
|
+
json (2.3.0)
|
19
19
|
m (1.5.1)
|
20
20
|
method_source (>= 0.6.7)
|
21
21
|
rake (>= 0.9.2.2)
|
22
22
|
method_source (0.9.2)
|
23
|
-
minitest (5.
|
24
|
-
parallel (1.
|
25
|
-
parser (2.
|
23
|
+
minitest (5.14.0)
|
24
|
+
parallel (1.19.1)
|
25
|
+
parser (2.7.0.2)
|
26
26
|
ast (~> 2.4.0)
|
27
27
|
rainbow (3.0.0)
|
28
|
-
rake (
|
29
|
-
rubocop (0.
|
28
|
+
rake (13.0.1)
|
29
|
+
rubocop (0.79.0)
|
30
30
|
jaro_winkler (~> 1.5.1)
|
31
31
|
parallel (~> 1.10)
|
32
|
-
parser (>= 2.
|
32
|
+
parser (>= 2.7.0.1)
|
33
33
|
rainbow (>= 2.2.2, < 4.0)
|
34
34
|
ruby-progressbar (~> 1.7)
|
35
35
|
unicode-display_width (>= 1.4.0, < 1.7)
|
@@ -39,12 +39,14 @@ GEM
|
|
39
39
|
json (>= 1.8, < 3)
|
40
40
|
simplecov-html (~> 0.10.0)
|
41
41
|
simplecov-html (0.10.2)
|
42
|
+
sync (0.5.0)
|
42
43
|
term-ansicolor (1.7.1)
|
43
44
|
tins (~> 1.0)
|
44
|
-
thor (0.
|
45
|
-
tins (1.
|
46
|
-
|
47
|
-
|
45
|
+
thor (1.0.1)
|
46
|
+
tins (1.24.0)
|
47
|
+
sync
|
48
|
+
unicode-display_width (1.6.1)
|
49
|
+
yard (0.9.24)
|
48
50
|
|
49
51
|
PLATFORMS
|
50
52
|
ruby
|
@@ -59,4 +61,4 @@ DEPENDENCIES
|
|
59
61
|
yard
|
60
62
|
|
61
63
|
BUNDLED WITH
|
62
|
-
2.
|
64
|
+
2.1.2
|
data/NEWS.md
CHANGED
@@ -1,16 +1,22 @@
|
|
1
1
|
# Cri News
|
2
2
|
|
3
|
+
## 2.15.10
|
4
|
+
|
5
|
+
Fixes:
|
6
|
+
|
7
|
+
- Fixed warnings appearing in Ruby 2.7 (9a3d810)
|
8
|
+
|
3
9
|
## 2.15.9
|
4
10
|
|
5
11
|
Fixes:
|
6
12
|
|
7
|
-
|
13
|
+
- Fixed bug which could cause options from one command appear in other commands (#101, #102)
|
8
14
|
|
9
15
|
## 2.15.8
|
10
16
|
|
11
17
|
Fixes:
|
12
18
|
|
13
|
-
|
19
|
+
- Don’t explicitly set default values for options (#99)
|
14
20
|
|
15
21
|
This release reverts a backwards-incompatible change introduced in 2.15.7.
|
16
22
|
|
@@ -63,89 +69,89 @@ This backwards-incompatible change was not intentional. To fix issue #94, a chan
|
|
63
69
|
|
64
70
|
Fixes:
|
65
71
|
|
66
|
-
|
72
|
+
- Options with a forbidden argument now default to false, rather than nil (#94, #96)
|
67
73
|
|
68
74
|
## 2.15.6
|
69
75
|
|
70
76
|
Fixes:
|
71
77
|
|
72
|
-
|
78
|
+
- Fixed problem with help header not being shown if the summary is missing (#93)
|
73
79
|
|
74
80
|
## 2.15.5
|
75
81
|
|
76
82
|
Fixes:
|
77
83
|
|
78
|
-
|
84
|
+
- Restored compatibility with Ruby 2.3. (#91)
|
79
85
|
|
80
86
|
## 2.15.4
|
81
87
|
|
82
88
|
Fixes:
|
83
89
|
|
84
|
-
|
90
|
+
- Removed dependency on `colored`, which restores functionality to gems that `colored` breaks (e.g. `awesome_print`) (#89, #90)
|
85
91
|
|
86
92
|
## 2.15.3
|
87
93
|
|
88
94
|
Fixes:
|
89
95
|
|
90
|
-
|
96
|
+
- Made `ArgumentList#each` callable without a block, in which case it returns an `Enumerator` (mimicking `Array`) (#87, #88)
|
91
97
|
|
92
98
|
## 2.15.2
|
93
99
|
|
94
100
|
Fixes:
|
95
101
|
|
96
|
-
|
102
|
+
- Fixed option propagation for two levels or more (#85, #86)
|
97
103
|
|
98
104
|
## 2.15.1
|
99
105
|
|
100
106
|
Fixes:
|
101
107
|
|
102
|
-
|
108
|
+
- Made -h/--help not fail when parameters are defined for the command that -h/--help is called on (#76, #78)
|
103
109
|
|
104
110
|
Enhancements:
|
105
111
|
|
106
|
-
|
112
|
+
- Made `#option` raise an error when unrecognised parameters are passed to it (#77) [Marc-André Lafortune]
|
107
113
|
|
108
114
|
## 2.15.0
|
109
115
|
|
110
116
|
Features:
|
111
117
|
|
112
|
-
|
118
|
+
- Added support for parameter transformation (#72)
|
113
119
|
|
114
120
|
## 2.14.0
|
115
121
|
|
116
122
|
Features:
|
117
123
|
|
118
|
-
|
124
|
+
- Added `Cri::Command.load_file`
|
119
125
|
|
120
126
|
## 2.13.0
|
121
127
|
|
122
128
|
Features:
|
123
129
|
|
124
|
-
|
130
|
+
- Added support for explicitly specifying zero parameters using `#no_params` (#71)
|
125
131
|
|
126
132
|
## 2.12.0
|
127
133
|
|
128
134
|
Features:
|
129
135
|
|
130
|
-
|
136
|
+
- Added support for parameter naming and validation (#70)
|
131
137
|
|
132
138
|
## 2.11.0
|
133
139
|
|
134
140
|
Features:
|
135
141
|
|
136
|
-
|
142
|
+
- Added support for transforming option values (#68)
|
137
143
|
|
138
144
|
## 2.10.1
|
139
145
|
|
140
146
|
Fixes:
|
141
147
|
|
142
|
-
|
148
|
+
- Restored Ruby 2.1 compatibility (for now)
|
143
149
|
|
144
150
|
## 2.10.0
|
145
151
|
|
146
152
|
Features:
|
147
153
|
|
148
|
-
|
154
|
+
- Added support for skipping option parsing (#62) [Tim Sharpe]
|
149
155
|
|
150
156
|
This release drops support for Ruby 2.1, which is no longer supported.
|
151
157
|
|
@@ -153,102 +159,102 @@ This release drops support for Ruby 2.1, which is no longer supported.
|
|
153
159
|
|
154
160
|
Fixes:
|
155
161
|
|
156
|
-
|
162
|
+
- Made default values be always returned, even when not explicitly specified (#57, #58)
|
157
163
|
|
158
164
|
## 2.9.0
|
159
165
|
|
160
166
|
Features:
|
161
167
|
|
162
|
-
|
168
|
+
- Allowed specifying default option value (#55)
|
163
169
|
|
164
170
|
Enhancements:
|
165
171
|
|
166
|
-
|
172
|
+
- Added support for specifying values for combined options (#56)
|
167
173
|
|
168
174
|
## 2.8.0
|
169
175
|
|
170
176
|
Features:
|
171
177
|
|
172
|
-
|
173
|
-
|
178
|
+
- Allowed passing `hard_exit: false` to `Command#run` to prevent `SystemExit` (#51)
|
179
|
+
- Allowed specifying the default subcommand (#54)
|
174
180
|
|
175
181
|
## 2.7.1
|
176
182
|
|
177
183
|
Fixes:
|
178
184
|
|
179
|
-
|
185
|
+
- Fixed some grammatical mistakes
|
180
186
|
|
181
187
|
## 2.7.0
|
182
188
|
|
183
189
|
Features:
|
184
190
|
|
185
|
-
|
191
|
+
- Added support for hidden options (#43, #44) [Bart Mesuere]
|
186
192
|
|
187
193
|
Enhancements:
|
188
194
|
|
189
|
-
|
190
|
-
|
195
|
+
- Added option values to help output (#37, #40, #41)
|
196
|
+
- Made option descriptions wrap (#36, #45) [Bart Mesuere]
|
191
197
|
|
192
198
|
## 2.6.1
|
193
199
|
|
194
|
-
|
200
|
+
- Disable ANSI color codes when not supported (#31, #32)
|
195
201
|
|
196
202
|
## 2.6.0
|
197
203
|
|
198
|
-
|
204
|
+
- Added support for multi-valued options (#29) [Toon Willems]
|
199
205
|
|
200
206
|
## 2.5.0
|
201
207
|
|
202
|
-
|
203
|
-
|
208
|
+
- Made the default help command handle subcommands (#27)
|
209
|
+
- Added `#raw` method to argument arrays, returning all arguments including `--` (#22)
|
204
210
|
|
205
211
|
## 2.4.1
|
206
212
|
|
207
|
-
|
208
|
-
|
213
|
+
- Fixed ordering of option groups on Ruby 1.8.x (#14, #15)
|
214
|
+
- Fixed ordering of commands when --verbose is passed (#16, #18)
|
209
215
|
|
210
216
|
## 2.4.0
|
211
217
|
|
212
|
-
|
213
|
-
|
214
|
-
|
218
|
+
- Allowed either short or long option to be, eh, optional (#9, #10) [Ken Coar]
|
219
|
+
- Fixed wrap-and-indent behavior (#12) [Ken Coar]
|
220
|
+
- Moved version information into `cri/version`
|
215
221
|
|
216
222
|
## 2.3.0
|
217
223
|
|
218
|
-
|
219
|
-
|
224
|
+
- Added colors (#1)
|
225
|
+
- Added support for marking commands as hidden
|
220
226
|
|
221
227
|
## 2.2.1
|
222
228
|
|
223
|
-
|
229
|
+
- Made command help sort subcommands
|
224
230
|
|
225
231
|
## 2.2.0
|
226
232
|
|
227
|
-
|
233
|
+
- Allowed commands with subcommands to have a run block
|
228
234
|
|
229
235
|
## 2.1.0
|
230
236
|
|
231
|
-
|
232
|
-
|
237
|
+
- Added support for runners
|
238
|
+
- Split up local/global command options
|
233
239
|
|
234
240
|
## 2.0.2
|
235
241
|
|
236
|
-
|
242
|
+
- Added command filename to stack traces
|
237
243
|
|
238
244
|
## 2.0.1
|
239
245
|
|
240
|
-
|
241
|
-
|
246
|
+
- Sorted ambiguous command names
|
247
|
+
- Restored compatibility with Ruby 1.8.x
|
242
248
|
|
243
249
|
## 2.0.0
|
244
250
|
|
245
|
-
|
246
|
-
|
251
|
+
- Added DSL
|
252
|
+
- Added support for nested commands
|
247
253
|
|
248
254
|
## 1.0.1
|
249
255
|
|
250
|
-
|
256
|
+
- Made gem actually include code. D'oh.
|
251
257
|
|
252
258
|
## 1.0.0
|
253
259
|
|
254
|
-
|
260
|
+
- Initial release!
|
data/lib/cri/command.rb
CHANGED
@@ -343,7 +343,7 @@ module Cri
|
|
343
343
|
explicitly_no_params?,
|
344
344
|
)
|
345
345
|
handle_errors_while { parser.run }
|
346
|
-
local_opts
|
346
|
+
local_opts = parser.options
|
347
347
|
global_opts = parent_opts.merge(parser.options)
|
348
348
|
global_opts = add_defaults(global_opts)
|
349
349
|
|
@@ -375,8 +375,8 @@ module Cri
|
|
375
375
|
#
|
376
376
|
# @option params [IO] :io ($stdout) the IO the help text is intended for.
|
377
377
|
# This influences the decision to enable/disable colored output.
|
378
|
-
def help(params
|
379
|
-
HelpRenderer.new(self, params).render
|
378
|
+
def help(**params)
|
379
|
+
HelpRenderer.new(self, **params).render
|
380
380
|
end
|
381
381
|
|
382
382
|
# Compares this command's name to the other given command's name.
|
data/lib/cri/command_dsl.rb
CHANGED
@@ -215,9 +215,9 @@ module Cri
|
|
215
215
|
# @deprecated
|
216
216
|
#
|
217
217
|
# @see #option
|
218
|
-
def required(short, long, desc, params
|
218
|
+
def required(short, long, desc, **params, &block)
|
219
219
|
params = params.merge(argument: :required)
|
220
|
-
option(short, long, desc, params, &block)
|
220
|
+
option(short, long, desc, **params, &block)
|
221
221
|
end
|
222
222
|
|
223
223
|
# Adds a new option with a forbidden argument to the command. If a block
|
@@ -238,9 +238,9 @@ module Cri
|
|
238
238
|
# @return [void]
|
239
239
|
#
|
240
240
|
# @see #option
|
241
|
-
def flag(short, long, desc, params
|
241
|
+
def flag(short, long, desc, **params, &block)
|
242
242
|
params = params.merge(argument: :forbidden)
|
243
|
-
option(short, long, desc, params, &block)
|
243
|
+
option(short, long, desc, **params, &block)
|
244
244
|
end
|
245
245
|
alias forbidden flag
|
246
246
|
|
@@ -264,9 +264,9 @@ module Cri
|
|
264
264
|
# @deprecated
|
265
265
|
#
|
266
266
|
# @see #option
|
267
|
-
def optional(short, long, desc, params
|
267
|
+
def optional(short, long, desc, **params, &block)
|
268
268
|
params = params.merge(argument: :optional)
|
269
|
-
option(short, long, desc, params, &block)
|
269
|
+
option(short, long, desc, **params, &block)
|
270
270
|
end
|
271
271
|
|
272
272
|
# Sets the run block to the given block. The given block should have two
|
data/lib/cri/help_renderer.rb
CHANGED
@@ -19,7 +19,7 @@ module Cri
|
|
19
19
|
#
|
20
20
|
# @option params [Boolean] :verbose true if the help output should be
|
21
21
|
# verbose, false otherwise.
|
22
|
-
def initialize(cmd, params
|
22
|
+
def initialize(cmd, **params)
|
23
23
|
@cmd = cmd
|
24
24
|
@is_verbose = params.fetch(:verbose, false)
|
25
25
|
@io = params.fetch(:io, $stdout)
|
@@ -13,16 +13,16 @@ module Cri
|
|
13
13
|
attr_reader :default
|
14
14
|
attr_reader :transform
|
15
15
|
|
16
|
-
def initialize(
|
17
|
-
@short =
|
18
|
-
@long =
|
19
|
-
@desc =
|
20
|
-
@argument =
|
21
|
-
@multiple =
|
22
|
-
@block =
|
23
|
-
@hidden =
|
24
|
-
@default =
|
25
|
-
@transform =
|
16
|
+
def initialize(short:, long:, desc:, argument:, multiple:, block:, hidden:, default:, transform:)
|
17
|
+
@short = short
|
18
|
+
@long = long
|
19
|
+
@desc = desc
|
20
|
+
@argument = argument
|
21
|
+
@multiple = multiple
|
22
|
+
@block = block
|
23
|
+
@hidden = hidden
|
24
|
+
@default = default
|
25
|
+
@transform = transform
|
26
26
|
|
27
27
|
if @short.nil? && @long.nil?
|
28
28
|
raise ArgumentError, 'short and long options cannot both be nil'
|
data/lib/cri/version.rb
CHANGED
data/test/test_command.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cri
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.15.
|
4
|
+
version: 2.15.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Denis Defreyne
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-21 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Cri allows building easy-to-use command-line interfaces with support
|
14
14
|
for subcommands.
|
@@ -74,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
requirements: []
|
77
|
-
rubygems_version: 3.
|
77
|
+
rubygems_version: 3.1.2
|
78
78
|
signing_key:
|
79
79
|
specification_version: 4
|
80
80
|
summary: a library for building easy-to-use command-line tools
|