rake-commander 0.4.2 → 0.4.3
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/.gitignore +2 -0
- data/.rubocop.yml +1 -1
- data/CHANGELOG.md +7 -1
- data/lib/rake-commander/option.rb +4 -6
- data/lib/rake-commander/options/arguments.rb +3 -3
- data/lib/rake-commander/options/result.rb +6 -1
- data/lib/rake-commander/version.rb +1 -1
- metadata +3 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: df772a60961a47e57f4904ffd9b813add5a6d4477a07834eb4f177fb25eb536a
|
|
4
|
+
data.tar.gz: 2a7225798390df7f5ed428092803e3e3d4facf31900bc9085f8cdda2b61122fd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 45e87f2067c2370748eb96d9929d133b8ccacdf724c100823cbf6a6a3374ad53b106f7d04742a0aee1e3bd6700668d49d0dc89285536b482c42fa580c788abbf
|
|
7
|
+
data.tar.gz: 907efaa1b66452cd63c43f36176a07462b0a7f4061196567aaa8b75fe572db0bf230245900488722b8acc39f7084b1abd968533e048607e15e6898ffe7ef935f
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -31,7 +31,7 @@ All notable changes to this project will be documented in this file.
|
|
|
31
31
|
- Example: `on_options(:t, :s, present: true) {|options| do-stuff}` <- block to be called only when the option `:t` and `:s` are both present in the parsed `options` result.
|
|
32
32
|
- Once this has been done, think about it being a hash-alike object with methods for the option names (i.e. `options.debug?`)
|
|
33
33
|
|
|
34
|
-
## [0.4.
|
|
34
|
+
## [0.4.4] - 2026-04-xx
|
|
35
35
|
|
|
36
36
|
### Added
|
|
37
37
|
|
|
@@ -39,6 +39,12 @@ All notable changes to this project will be documented in this file.
|
|
|
39
39
|
|
|
40
40
|
### Changed
|
|
41
41
|
|
|
42
|
+
## [0.4.3] - 2026-04-15
|
|
43
|
+
|
|
44
|
+
### Fixed
|
|
45
|
+
|
|
46
|
+
- Option block wasn't correctly handling `value`.
|
|
47
|
+
|
|
42
48
|
## [0.4.2] - 2025-02-25
|
|
43
49
|
|
|
44
50
|
### Fixed
|
|
@@ -178,12 +178,10 @@ class RakeCommander
|
|
|
178
178
|
block_extra_args = [default, short, name, self]
|
|
179
179
|
|
|
180
180
|
proc do |value|
|
|
181
|
-
value = !value
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
middleware&.call(*args)
|
|
181
|
+
value = !value if type_coercion == FalseClass
|
|
182
|
+
value = original_block.call(value, *block_extra_args) if original_block
|
|
183
|
+
value = middleware.call(value, *block_extra_args) if middleware
|
|
184
|
+
value
|
|
187
185
|
end
|
|
188
186
|
end
|
|
189
187
|
|
|
@@ -3,8 +3,8 @@ class RakeCommander
|
|
|
3
3
|
# Offers helpers to treat `ARGV`
|
|
4
4
|
module Arguments
|
|
5
5
|
RAKE_COMMAND_EXTENDED_OPTIONS_START = '--'.freeze
|
|
6
|
-
NAME_ARGUMENT = /^--(?<option>[\
|
|
7
|
-
BOOLEAN_ARGUMENT = /(?:^|--)no-(?<option>[\
|
|
6
|
+
NAME_ARGUMENT = /^--(?<option>[\w-]*).*?$/ # \w already has _
|
|
7
|
+
BOOLEAN_ARGUMENT = /(?:^|--)no-(?<option>[\w-]*).*?$/
|
|
8
8
|
|
|
9
9
|
class << self
|
|
10
10
|
def included(base)
|
|
@@ -237,7 +237,7 @@ class RakeCommander
|
|
|
237
237
|
argv.each_with_object([]) do |arg, out|
|
|
238
238
|
if single_hyphen?(arg) # short option(s)
|
|
239
239
|
options = arg.match(SINGLE_HYPHEN_REGEX)[:options]
|
|
240
|
-
options.split('').each do |short|
|
|
240
|
+
options.split('').each do |short| # rubocop:disable Style/StringChars
|
|
241
241
|
out << short_sym(short)
|
|
242
242
|
end
|
|
243
243
|
elsif double_hyphen?(arg) # name option
|
|
@@ -34,7 +34,12 @@ class RakeCommander
|
|
|
34
34
|
# @param results [Hash] with `short` option as `key` and final value as `value`.
|
|
35
35
|
# @see `RakeCommander::Options#parse_options`
|
|
36
36
|
def parse_options(argv = ARGV, results: {}, leftovers: [], &middleware)
|
|
37
|
-
leftovers.push(
|
|
37
|
+
leftovers.push(
|
|
38
|
+
*super(
|
|
39
|
+
argv,
|
|
40
|
+
&results_collector(results, &middleware)
|
|
41
|
+
)
|
|
42
|
+
)
|
|
38
43
|
end
|
|
39
44
|
|
|
40
45
|
# **Extend** method to ensure options are parsed before calling task.
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rake-commander
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Oscar Segura Samper
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: dotenv
|
|
@@ -124,7 +123,6 @@ dependencies:
|
|
|
124
123
|
- - "<"
|
|
125
124
|
- !ruby/object:Gem::Version
|
|
126
125
|
version: '14'
|
|
127
|
-
description:
|
|
128
126
|
email:
|
|
129
127
|
- oscar@ecoportal.co.nz
|
|
130
128
|
executables: []
|
|
@@ -191,7 +189,6 @@ licenses:
|
|
|
191
189
|
- MIT
|
|
192
190
|
metadata:
|
|
193
191
|
rubygems_mfa_required: 'true'
|
|
194
|
-
post_install_message:
|
|
195
192
|
rdoc_options: []
|
|
196
193
|
require_paths:
|
|
197
194
|
- lib
|
|
@@ -206,8 +203,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
206
203
|
- !ruby/object:Gem::Version
|
|
207
204
|
version: '0'
|
|
208
205
|
requirements: []
|
|
209
|
-
rubygems_version:
|
|
210
|
-
signing_key:
|
|
206
|
+
rubygems_version: 4.0.8
|
|
211
207
|
specification_version: 4
|
|
212
208
|
summary: Classing rake tasks with options. Creating re-usable tasks, options and samples
|
|
213
209
|
thereof.
|