command_kit 0.5.3 → 0.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ChangeLog.md +20 -0
- data/lib/command_kit/interactive.rb +2 -2
- data/lib/command_kit/options.rb +13 -9
- data/lib/command_kit/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a99a41f5bf2442e5523f9f7019dcd6b916f1b645786eefa9b0fb2a84aadd28c
|
4
|
+
data.tar.gz: 3fb73eaa7b3a5730baafd0d0bd02cc567e82020acc96dec6a87bf726666f4250
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44673dd7cb91fe176210e319c4055010c4e81af5dabf7eb420b202c1d42637e4844a1f5c99e0d81eeb52d32bfe9221de843b86c8d1f7fc91cc4aece561b46402
|
7
|
+
data.tar.gz: 2470a9c111f829fc858c03f8b9be2726028d59da449bd68f778f7d87dc3f6bd93051ad4339ea896fa15f81dbcba3fe06af0b3b1b72f4705108a6cbab5157cba1
|
data/ChangeLog.md
CHANGED
@@ -1,3 +1,23 @@
|
|
1
|
+
### 0.5.5 / 2024-04-08
|
2
|
+
|
3
|
+
#### CommandKit::Interactive
|
4
|
+
|
5
|
+
* Ensure that the interactive prompt is re-printed when no input is entered
|
6
|
+
and input is required from the user.
|
7
|
+
|
8
|
+
#### CommandKit::Options
|
9
|
+
|
10
|
+
* Do not pass an Array of Regexp captures for an option's value Regexp type
|
11
|
+
into an option's block, if the option's block only accepts one argument.
|
12
|
+
Instead, only pass the option's value as a String.
|
13
|
+
|
14
|
+
### 0.5.4 / 2024-03-14
|
15
|
+
|
16
|
+
#### CommandKit::Options
|
17
|
+
|
18
|
+
* Fixed a bug where `Array` option values were only setting the option's value
|
19
|
+
to the first element of the parsed `Array` value.
|
20
|
+
|
1
21
|
### 0.5.3 / 2024-03-12
|
2
22
|
|
3
23
|
#### CommandKit::Interactive
|
data/lib/command_kit/options.rb
CHANGED
@@ -302,17 +302,21 @@ module CommandKit
|
|
302
302
|
# @param [Option] option
|
303
303
|
#
|
304
304
|
def define_option(option)
|
305
|
-
default_value = option.default_value
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
option_parser.on(*option.usage,option.type,*option.desc) do |arg,*captures|
|
310
|
-
@options[option.name] = arg
|
305
|
+
unless (default_value = option.default_value).nil?
|
306
|
+
@options[option.name] = default_value
|
307
|
+
end
|
311
308
|
|
312
|
-
|
313
|
-
|
309
|
+
option_parser.on(*option.usage,option.type,*option.desc) do |value|
|
310
|
+
if option.type.is_a?(Regexp) && value.is_a?(Array)
|
311
|
+
# separate the optiona value from the additional Regexp captures
|
312
|
+
value, *args = value
|
313
|
+
else
|
314
|
+
args = nil
|
314
315
|
end
|
315
|
-
|
316
|
+
|
317
|
+
@options[option.name] = value
|
318
|
+
instance_exec(value,*args,&option.block) if option.block
|
319
|
+
end
|
316
320
|
end
|
317
321
|
end
|
318
322
|
end
|
data/lib/command_kit/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: command_kit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Postmodern
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-04-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|