cri 2.15.10 → 2.15.12

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: 4ac76773abd662b4cdd83c22ade38073436ae16afeef75ad95060578b71c23ea
4
- data.tar.gz: 4386555ef8c6d3c27f77205120291efc1898be80973550a81271a89ddaef8495
3
+ metadata.gz: d81666ca6a340e984db64435f69d16a568ec524f5f4339414f17a7b2a357ebd7
4
+ data.tar.gz: a082b81e9645556563989909db54d57dd44c12a7848562e3c44c7a61fc29a938
5
5
  SHA512:
6
- metadata.gz: f096a5583428ecdca24ad0a800488cb07269d181bc853c6872d34caf7167b6d2d42fb0c2851da24eee4ed4fd1d0ed9e83aa2c75ed644275cb88ac081f0950ed7
7
- data.tar.gz: 02645607f896fcc9ebf2f432d16f3b1b37f8688e4eca21d288bfa0e781c4e0cd2aa5125172ffde92fdec2a14f18220f93e454feb57449f88f7a95f1a0d2b9ef0
6
+ metadata.gz: 416908fc772aa7a643232dcab1bb3b2b63e64b285b4f4c2f6289cb1a8bf586591e2c2f1e733d79b031ba65391b4d7679b58813bbec2adfd73f0d30e5ce249d64
7
+ data.tar.gz: 789004b071d88642cec16f501a3d0f94a2bb9a23c95582782102378a2e6122bdafe209227d4bb77cdcc4304d6f40f02bb1dd8e7835080e7c58a7eb238fd8a49e
data/Gemfile CHANGED
@@ -4,9 +4,10 @@ source 'https://rubygems.org'
4
4
 
5
5
  gemspec
6
6
 
7
- gem 'coveralls'
8
7
  gem 'm', '~> 1.5'
9
8
  gem 'minitest'
10
9
  gem 'rake'
11
10
  gem 'rubocop'
11
+ gem 'rubocop-minitest', '~> 0.10.2'
12
+ gem 'rubocop-rake', '~> 0.5.1'
12
13
  gem 'yard'
data/Gemfile.lock CHANGED
@@ -1,64 +1,64 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cri (2.15.10)
4
+ cri (2.15.12)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- ast (2.4.0)
10
- coveralls (0.8.23)
11
- json (>= 1.8, < 3)
12
- simplecov (~> 0.16.1)
13
- term-ansicolor (~> 1.3)
14
- thor (>= 0.19.4, < 2.0)
15
- tins (~> 1.6)
16
- docile (1.3.2)
17
- jaro_winkler (1.5.4)
18
- json (2.3.0)
19
- m (1.5.1)
9
+ ast (2.4.2)
10
+ json (2.7.2)
11
+ language_server-protocol (3.17.0.3)
12
+ m (1.6.2)
20
13
  method_source (>= 0.6.7)
21
14
  rake (>= 0.9.2.2)
22
- method_source (0.9.2)
23
- minitest (5.14.0)
24
- parallel (1.19.1)
25
- parser (2.7.0.2)
26
- ast (~> 2.4.0)
27
- rainbow (3.0.0)
28
- rake (13.0.1)
29
- rubocop (0.79.0)
30
- jaro_winkler (~> 1.5.1)
15
+ method_source (1.1.0)
16
+ minitest (5.23.1)
17
+ parallel (1.25.1)
18
+ parser (3.3.2.0)
19
+ ast (~> 2.4.1)
20
+ racc
21
+ racc (1.8.0)
22
+ rainbow (3.1.1)
23
+ rake (13.2.1)
24
+ regexp_parser (2.9.2)
25
+ rexml (3.2.9)
26
+ strscan
27
+ rubocop (1.64.1)
28
+ json (~> 2.3)
29
+ language_server-protocol (>= 3.17.0)
31
30
  parallel (~> 1.10)
32
- parser (>= 2.7.0.1)
31
+ parser (>= 3.3.0.2)
33
32
  rainbow (>= 2.2.2, < 4.0)
33
+ regexp_parser (>= 1.8, < 3.0)
34
+ rexml (>= 3.2.5, < 4.0)
35
+ rubocop-ast (>= 1.31.1, < 2.0)
34
36
  ruby-progressbar (~> 1.7)
35
- unicode-display_width (>= 1.4.0, < 1.7)
36
- ruby-progressbar (1.10.1)
37
- simplecov (0.16.1)
38
- docile (~> 1.1)
39
- json (>= 1.8, < 3)
40
- simplecov-html (~> 0.10.0)
41
- simplecov-html (0.10.2)
42
- sync (0.5.0)
43
- term-ansicolor (1.7.1)
44
- tins (~> 1.0)
45
- thor (1.0.1)
46
- tins (1.24.0)
47
- sync
48
- unicode-display_width (1.6.1)
49
- yard (0.9.24)
37
+ unicode-display_width (>= 2.4.0, < 3.0)
38
+ rubocop-ast (1.31.3)
39
+ parser (>= 3.3.1.0)
40
+ rubocop-minitest (0.10.3)
41
+ rubocop (>= 0.87, < 2.0)
42
+ rubocop-rake (0.5.1)
43
+ rubocop
44
+ ruby-progressbar (1.13.0)
45
+ strscan (3.1.0)
46
+ unicode-display_width (2.5.0)
47
+ yard (0.9.36)
50
48
 
51
49
  PLATFORMS
50
+ arm64-darwin-23
52
51
  ruby
53
52
 
54
53
  DEPENDENCIES
55
- coveralls
56
54
  cri!
57
55
  m (~> 1.5)
58
56
  minitest
59
57
  rake
60
58
  rubocop
59
+ rubocop-minitest (~> 0.10.2)
60
+ rubocop-rake (~> 0.5.1)
61
61
  yard
62
62
 
63
63
  BUNDLED WITH
64
- 2.1.2
64
+ 2.5.11
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2015 Denis Defreyne and contributors
1
+ Copyright (c) 2015–ω Denis Defreyne and contributors
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to deal
data/NEWS.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Cri News
2
2
 
3
+ ## 2.15.12
4
+
5
+ Changes:
6
+
7
+ - Dropped support for Ruby 2.5
8
+
9
+ ## 2.15.11
10
+
11
+ Fixes:
12
+
13
+ - Added support for Ruby 3.0 (#111)
14
+
15
+ Changes:
16
+
17
+ - Dropped support for Ruby 2.3 and 2.4 (#112)
18
+
3
19
  ## 2.15.10
4
20
 
5
21
  Fixes:
data/README.md CHANGED
@@ -2,24 +2,20 @@
2
2
 
3
3
  [![Gem](http://img.shields.io/gem/v/cri.svg)](http://rubygems.org/gems/cri)
4
4
  [![Gem downloads](https://img.shields.io/gem/dt/cri.svg)](http://rubygems.org/gems/cri)
5
- [![Travis](http://img.shields.io/travis/ddfreyne/cri.svg)](https://travis-ci.org/ddfreyne/cri)
6
- [![Coveralls](http://img.shields.io/coveralls/ddfreyne/cri.svg)](https://coveralls.io/r/ddfreyne/cri)
7
- [![Codeclimate](http://img.shields.io/codeclimate/github/ddfreyne/cri.svg)](https://codeclimate.com/github/ddfreyne/cri)
8
- [![Inch](http://inch-ci.org/github/ddfreyne/cri.svg)](http://inch-ci.org/github/ddfreyne/cri/)
9
5
 
10
6
  Cri is a library for building easy-to-use command-line tools with support for
11
7
  nested commands.
12
8
 
13
9
  ## Requirements
14
10
 
15
- Cri requires Ruby 2.3 or newer.
11
+ Cri requires Ruby 2.6 or newer (including Ruby 3.x).
16
12
 
17
13
  ## Compatibility policy
18
14
 
19
15
  Cri is guaranteed to be supported on any [officially supported Ruby version](https://www.ruby-lang.org/en/downloads/branches/), as well as the version of Ruby that comes by default on
20
16
 
21
- * the last two [Ubuntu LTS releases](https://wiki.ubuntu.com/Releases)
22
- * the last two major [macOS releases](https://en.wikipedia.org/wiki/MacOS_version_history)
17
+ - the last two [Ubuntu LTS releases](https://wiki.ubuntu.com/Releases)
18
+ - the last two major [macOS releases](https://en.wikipedia.org/wiki/MacOS_version_history)
23
19
 
24
20
  ## Usage
25
21
 
@@ -119,101 +115,101 @@ The most generic way of definition an option is using either `#option` or `#opt`
119
115
  2. a long option name
120
116
  3. a description
121
117
  4. optional extra parameters
122
- * `argument:` (default: `:forbidden`)
123
- * `transform:`
124
- * `default:`
125
- * `multiple:` (default: `false`)
118
+ - `argument:` (default: `:forbidden`)
119
+ - `transform:`
120
+ - `default:`
121
+ - `multiple:` (default: `false`)
126
122
  5. optionally, a block
127
123
 
128
124
  In more detail:
129
125
 
130
- * The short option name is a symbol containing one character, to be used in single-dash options, e.g. `:f` (corresponds to `-f`). The long option name is a symbol containing a string, to be used in double-dash options, e.g. `:force` (corresponds to `--force`). Either the short or the long option name can be nil, but not both.
126
+ - The short option name is a symbol containing one character, to be used in single-dash options, e.g. `:f` (corresponds to `-f`). The long option name is a symbol containing a string, to be used in double-dash options, e.g. `:force` (corresponds to `--force`). Either the short or the long option name can be nil, but not both.
131
127
 
132
- * The description is a short, one-line text that shows up in the command’s help. For example, the `-v`/`--version` option might have the description `show version information and quit`.
128
+ - The description is a short, one-line text that shows up in the command’s help. For example, the `-v`/`--version` option might have the description `show version information and quit`.
133
129
 
134
- * The extra parameters, `argument:`, `multiple:`, `default:`, and `transform:`, are described in the sections below.
130
+ - The extra parameters, `argument:`, `multiple:`, `default:`, and `transform:`, are described in the sections below.
135
131
 
136
- * The block, if given, will be executed when the option is found. The arguments to the block are the option value (`true` in case the option does not have an argument) and the command.
132
+ - The block, if given, will be executed when the option is found. The arguments to the block are the option value (`true` in case the option does not have an argument) and the command.
137
133
 
138
134
  There are several convenience methods that are alternatives to `#option`/`#opt`:
139
135
 
140
- * `#flag` sets `argument:` to `:forbidden`
141
- * (**deprecated**) `#required` sets `argument:` to `:required` -- deprecated because `#required` suggests that the option is required, wich is incorrect; the _argument_ is required.)
142
- * (**deprecated**) `#optional` sets `argument:` to `:optional` -- deprecated because `#optional` looks too similar to `#option`.
136
+ - `#flag` sets `argument:` to `:forbidden`
137
+ - (**deprecated**) `#required` sets `argument:` to `:required` -- deprecated because `#required` suggests that the option is required, wich is incorrect; the _argument_ is required.)
138
+ - (**deprecated**) `#optional` sets `argument:` to `:optional` -- deprecated because `#optional` looks too similar to `#option`.
143
139
 
144
140
  #### Forbidden, required, and optional arguments (`argument:`)
145
141
 
146
142
  The `:argument` parameter can be set to `:forbidden`, `:required`, or `:optional`.
147
143
 
148
- * `:forbidden` means that when the option is present, the value will be set to `true`, and `false` otherwise. For example:
144
+ - `:forbidden` means that when the option is present, the value will be set to `true`, and `false` otherwise. For example:
149
145
 
150
- ```ruby
151
- option :f, :force, 'push with force', argument: :forbidden
146
+ ```ruby
147
+ option :f, :force, 'push with force', argument: :forbidden
152
148
 
153
- run do |opts, args, cmd|
154
- puts "Force? #{opts[:force]}"
155
- end
156
- ```
149
+ run do |opts, args, cmd|
150
+ puts "Force? #{opts[:force]}"
151
+ end
152
+ ```
157
153
 
158
- ```sh
159
- % ./push mypackage.zip
160
- Force? false
154
+ ```sh
155
+ % ./push mypackage.zip
156
+ Force? false
161
157
 
162
- % ./push --force mypackage.zip
163
- Force? true
164
- ```
158
+ % ./push --force mypackage.zip
159
+ Force? true
160
+ ```
165
161
 
166
- `:argument` is set to `:forbidden` by default.
162
+ `:argument` is set to `:forbidden` by default.
167
163
 
168
- * `:required` means that the option must be followed by an argument, which will then be treated as the value for the option. It does not mean that the option itself is required. For example:
164
+ - `:required` means that the option must be followed by an argument, which will then be treated as the value for the option. It does not mean that the option itself is required. For example:
169
165
 
170
- ```ruby
171
- option :o, :output, 'specify output file', argument: :required
172
- option :f, :fast, 'fetch faster', argument: :forbidden
166
+ ```ruby
167
+ option :o, :output, 'specify output file', argument: :required
168
+ option :f, :fast, 'fetch faster', argument: :forbidden
173
169
 
174
- run do |opts, args, cmd|
175
- puts "Output file: #{opts[:output]}"
176
- end
177
- ```
170
+ run do |opts, args, cmd|
171
+ puts "Output file: #{opts[:output]}"
172
+ end
173
+ ```
178
174
 
179
- ```sh
180
- % ./fetch http://example.com/source.zip
181
- Output file: nil
175
+ ```sh
176
+ % ./fetch http://example.com/source.zip
177
+ Output file: nil
182
178
 
183
- % ./fetch --output example.zip http://example.com/source.zip
184
- Output file: example.zip
179
+ % ./fetch --output example.zip http://example.com/source.zip
180
+ Output file: example.zip
185
181
 
186
- % ./fetch http://example.com/source.zip --output
187
- fetch: option requires an argument -- output
182
+ % ./fetch http://example.com/source.zip --output
183
+ fetch: option requires an argument -- output
188
184
 
189
- % ./fetch --output --fast http://example.com/source.zip
190
- fetch: option requires an argument -- output
191
- ```
185
+ % ./fetch --output --fast http://example.com/source.zip
186
+ fetch: option requires an argument -- output
187
+ ```
192
188
 
193
- * `:optional` means that the option can be followed by an argument. If it is, then the argument is treated as the value for the option; if it isn’t, the value for the option will be `true`. For example:
189
+ - `:optional` means that the option can be followed by an argument. If it is, then the argument is treated as the value for the option; if it isn’t, the value for the option will be `true`. For example:
194
190
 
195
- ```ruby
196
- option :o, :output, 'specify output file', argument: :optional
197
- option :f, :fast, 'fetch faster', argument: :forbidden
191
+ ```ruby
192
+ option :o, :output, 'specify output file', argument: :optional
193
+ option :f, :fast, 'fetch faster', argument: :forbidden
198
194
 
199
- run do |opts, args, cmd|
200
- puts "Output file: #{opts[:output]}"
201
- end
202
- ```
195
+ run do |opts, args, cmd|
196
+ puts "Output file: #{opts[:output]}"
197
+ end
198
+ ```
203
199
 
204
- ```sh
205
- % ./fetch http://example.com/source.zip
206
- Output file: nil
200
+ ```sh
201
+ % ./fetch http://example.com/source.zip
202
+ Output file: nil
207
203
 
208
- % ./fetch --output example.zip http://example.com/source.zip
209
- Output file: example.zip
204
+ % ./fetch --output example.zip http://example.com/source.zip
205
+ Output file: example.zip
210
206
 
211
- % ./fetch http://example.com/source.zip --output
212
- Output file: true
207
+ % ./fetch http://example.com/source.zip --output
208
+ Output file: true
213
209
 
214
- % ./fetch --output --fast http://example.com/source.zip
215
- Output file: true
216
- ```
210
+ % ./fetch --output --fast http://example.com/source.zip
211
+ Output file: true
212
+ ```
217
213
 
218
214
  #### Transforming options (`transform:`)
219
215
 
@@ -374,7 +370,7 @@ As with options, parameter definitions take `transform:`, which can be used for
374
370
  param :port, transform: method(:Integer)
375
371
  ```
376
372
 
377
- (*Why the distinction between argument and parameter?* A parameter is a name, e.g. `filename`, while an argument is a value for a parameter, e.g. `kitten.jpg`.)
373
+ (_Why the distinction between argument and parameter?_ A parameter is a name, e.g. `filename`, while an argument is a value for a parameter, e.g. `kitten.jpg`.)
378
374
 
379
375
  ### Allowing arbitrary arguments
380
376
 
@@ -584,10 +580,10 @@ cmd = Cri::Command.load_file('commands/check.rb', infer_name: true)
584
580
 
585
581
  ## Contributors
586
582
 
587
- * Bart Mesuere
588
- * Ken Coar
589
- * Tim Sharpe
590
- * Toon Willems
583
+ - Bart Mesuere
584
+ - Ken Coar
585
+ - Tim Sharpe
586
+ - Toon Willems
591
587
 
592
588
  Thanks for Lee “injekt” Jarvis for [Slop](https://github.com/injekt/slop),
593
589
  which has inspired the design of Cri 2.0.
data/cri.gemspec CHANGED
@@ -16,8 +16,9 @@ Gem::Specification.new do |s|
16
16
  s.files = Dir['[A-Z]*'] + Dir['{lib,test}/**/*'] + ['cri.gemspec']
17
17
  s.require_paths = ['lib']
18
18
 
19
- s.required_ruby_version = '~> 2.3'
19
+ s.required_ruby_version = '>= 2.6'
20
20
 
21
21
  s.rdoc_options = ['--main', 'README.md']
22
22
  s.extra_rdoc_files = ['LICENSE', 'README.md', 'NEWS.md']
23
+ s.metadata['rubygems_mfa_required'] = 'true'
23
24
  end
@@ -6,12 +6,7 @@ module Cri
6
6
  # Error that will be raised when an incorrect number of arguments is given.
7
7
  class ArgumentCountMismatchError < Cri::Error
8
8
  def initialize(expected_count, actual_count)
9
- @expected_count = expected_count
10
- @actual_count = actual_count
11
- end
12
-
13
- def message
14
- "incorrect number of arguments given: expected #{@expected_count}, but got #{@actual_count}"
9
+ super("incorrect number of arguments given: expected #{expected_count}, but got #{actual_count}")
15
10
  end
16
11
  end
17
12
 
data/lib/cri/command.rb CHANGED
@@ -46,6 +46,8 @@ module Cri
46
46
  # @api private
47
47
  class CriExitException < StandardError
48
48
  def initialize(is_error:)
49
+ super('exit requested')
50
+
49
51
  @is_error = is_error
50
52
  end
51
53
 
@@ -8,12 +8,7 @@ module Cri
8
8
  # already declared as taken no params.
9
9
  class AlreadySpecifiedAsNoParams < Cri::Error
10
10
  def initialize(param, command)
11
- @param = param
12
- @command = command
13
- end
14
-
15
- def message
16
- "Attempted to specify a parameter #{@param.inspect} to the command #{@command.name.inspect}, which is already specified as taking no params. Suggestion: remove the #no_params call."
11
+ super("Attempted to specify a parameter #{param.inspect} to the command #{command.name.inspect}, which is already specified as taking no params. Suggestion: remove the #no_params call.")
17
12
  end
18
13
  end
19
14
 
@@ -21,11 +16,7 @@ module Cri
21
16
  # parameters, when the command is already declared with parameters.
22
17
  class AlreadySpecifiedWithParams < Cri::Error
23
18
  def initialize(command)
24
- @command = command
25
- end
26
-
27
- def message
28
- "Attempted to declare the command #{@command.name.inspect} as taking no parameters, but some parameters are already declared for this command. Suggestion: remove the #no_params call."
19
+ super("Attempted to declare the command #{command.name.inspect} as taking no parameters, but some parameters are already declared for this command. Suggestion: remove the #no_params call.")
29
20
  end
30
21
  end
31
22
 
@@ -78,7 +78,7 @@ module Cri
78
78
 
79
79
  text << "\n"
80
80
  text << fmt.format_as_title('description', @io) << "\n"
81
- text << fmt.wrap_and_indent(@cmd.description, LINE_WIDTH, DESC_INDENT) + "\n"
81
+ text << (fmt.wrap_and_indent(@cmd.description, LINE_WIDTH, DESC_INDENT) + "\n")
82
82
  end
83
83
 
84
84
  def append_subcommands(text)
@@ -120,7 +120,7 @@ module Cri
120
120
  string << '-X'
121
121
 
122
122
  if opt_defn.long
123
- string << ' --' + opt_defn.long
123
+ string << (' --' + opt_defn.long)
124
124
  end
125
125
 
126
126
  case opt_defn.argument
@@ -213,7 +213,7 @@ module Cri
213
213
  opt_text_len += 2 + opt_defn.long.size if opt_defn.long
214
214
  opt_text_len += long_value_postfix.size
215
215
 
216
- ' ' + opt_text + ' ' * (length + OPT_DESC_SPACING - opt_text_len)
216
+ ' ' + opt_text + (' ' * (length + OPT_DESC_SPACING - opt_text_len))
217
217
  end
218
218
  end
219
219
  end
data/lib/cri/parser.rb CHANGED
@@ -14,12 +14,10 @@ module Cri
14
14
  attr_reader :value
15
15
 
16
16
  def initialize(definition, value)
17
- @definition = definition
18
- @value = value
19
- end
17
+ super("invalid value #{value.inspect} for #{definition.formatted_name} option")
20
18
 
21
- def message
22
- "invalid value #{value.inspect} for #{@definition.formatted_name} option"
19
+ @value = value
20
+ @definition = definition
23
21
  end
24
22
  end
25
23
 
data/lib/cri/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Cri
4
4
  # The current Cri version.
5
- VERSION = '2.15.10'
5
+ VERSION = '2.15.12'
6
6
  end
data/test/helper.rb CHANGED
@@ -1,8 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'coveralls'
4
- Coveralls.wear!
5
-
6
3
  require 'minitest'
7
4
  require 'minitest/autorun'
8
5
 
@@ -52,4 +49,4 @@ module Cri
52
49
  end
53
50
 
54
51
  # Unexpected system exit is unexpected
55
- ::MiniTest::Unit::TestCase::PASSTHROUGH_EXCEPTIONS.delete(SystemExit)
52
+ ::Minitest::Test::PASSTHROUGH_EXCEPTIONS.delete(SystemExit)
@@ -98,7 +98,7 @@ module Cri
98
98
  end
99
99
 
100
100
  def test_transform
101
- param_defns = [Cri::ParamDefinition.new(name: 'filename', transform: ->(a) { a.upcase })]
101
+ param_defns = [Cri::ParamDefinition.new(name: 'filename', transform: lambda(&:upcase))]
102
102
  args = Cri::ArgumentList.new(%w[notbad.jpg], false, param_defns)
103
103
 
104
104
  assert_equal(['NOTBAD.JPG'], args.to_a)
data/test/test_command.rb CHANGED
@@ -950,7 +950,7 @@ module Cri
950
950
  def test_required_option_defaults_to_given_value_with_transform
951
951
  cmd = Cri::Command.define do
952
952
  name 'a'
953
- option :a, :animal, 'specify animal', argument: :required, transform: ->(a) { a.upcase }, default: 'cow'
953
+ option :a, :animal, 'specify animal', argument: :required, transform: lambda(&:upcase), default: 'cow'
954
954
 
955
955
  run do |opts, _args, _cmd|
956
956
  puts "Animal = #{opts[:animal]}"
@@ -286,7 +286,7 @@ module Cri
286
286
  summary 'does stuff'
287
287
  description 'This command does a lot of stuff.'
288
288
 
289
- param :foo, transform: ->(a) { a.upcase }
289
+ param :foo, transform: lambda(&:upcase)
290
290
 
291
291
  run do |_opts, args|
292
292
  $args_num = { foo: args[0] }
data/test/test_parser.rb CHANGED
@@ -443,7 +443,7 @@ module Cri
443
443
  input = %w[localhost]
444
444
  param_defns = [
445
445
  { name: 'host', transform: nil },
446
- ].map { |hash| Cri::ParamDefinition.new(hash) }
446
+ ].map { |hash| Cri::ParamDefinition.new(**hash) }
447
447
 
448
448
  parser = Cri::Parser.new(input, [], param_defns, false).run
449
449
  assert_equal({}, parser.options)
@@ -455,7 +455,7 @@ module Cri
455
455
  input = []
456
456
  param_defns = [
457
457
  { name: 'host', transform: nil },
458
- ].map { |hash| Cri::ParamDefinition.new(hash) }
458
+ ].map { |hash| Cri::ParamDefinition.new(**hash) }
459
459
 
460
460
  parser = Cri::Parser.new(input, [], param_defns, false).run
461
461
  exception = assert_raises(Cri::ArgumentList::ArgumentCountMismatchError) do
@@ -468,7 +468,7 @@ module Cri
468
468
  input = %w[localhost oink]
469
469
  param_defns = [
470
470
  { name: 'host', transform: nil },
471
- ].map { |hash| Cri::ParamDefinition.new(hash) }
471
+ ].map { |hash| Cri::ParamDefinition.new(**hash) }
472
472
 
473
473
  parser = Cri::Parser.new(input, [], param_defns, false).run
474
474
  exception = assert_raises(Cri::ArgumentList::ArgumentCountMismatchError) do
@@ -481,7 +481,7 @@ module Cri
481
481
  input = %w[localhost]
482
482
  param_defns = [
483
483
  { name: 'host', transform: nil },
484
- ].map { |hash| Cri::ParamDefinition.new(hash) }
484
+ ].map { |hash| Cri::ParamDefinition.new(**hash) }
485
485
 
486
486
  parser = Cri::Parser.new(input, [], param_defns, false).run
487
487
 
@@ -496,7 +496,7 @@ module Cri
496
496
  param_defns = [
497
497
  { name: 'source', transform: nil },
498
498
  { name: 'target', transform: nil },
499
- ].map { |hash| Cri::ParamDefinition.new(hash) }
499
+ ].map { |hash| Cri::ParamDefinition.new(**hash) }
500
500
 
501
501
  parser = Cri::Parser.new(input, [], param_defns, false).run
502
502
  assert_equal({}, parser.options)
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.10
4
+ version: 2.15.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Defreyne
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-21 00:00:00.000000000 Z
11
+ date: 2024-06-09 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.
@@ -56,8 +56,9 @@ files:
56
56
  homepage: https://github.com/ddfreyne/cri
57
57
  licenses:
58
58
  - MIT
59
- metadata: {}
60
- post_install_message:
59
+ metadata:
60
+ rubygems_mfa_required: 'true'
61
+ post_install_message:
61
62
  rdoc_options:
62
63
  - "--main"
63
64
  - README.md
@@ -65,17 +66,17 @@ require_paths:
65
66
  - lib
66
67
  required_ruby_version: !ruby/object:Gem::Requirement
67
68
  requirements:
68
- - - "~>"
69
+ - - ">="
69
70
  - !ruby/object:Gem::Version
70
- version: '2.3'
71
+ version: '2.6'
71
72
  required_rubygems_version: !ruby/object:Gem::Requirement
72
73
  requirements:
73
74
  - - ">="
74
75
  - !ruby/object:Gem::Version
75
76
  version: '0'
76
77
  requirements: []
77
- rubygems_version: 3.1.2
78
- signing_key:
78
+ rubygems_version: 3.5.11
79
+ signing_key:
79
80
  specification_version: 4
80
81
  summary: a library for building easy-to-use command-line tools
81
82
  test_files: []