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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5593c671006f7e7e95feee9f6b173e0d9df9ce37e39c965b12a9c4c8970d7a06
4
- data.tar.gz: f64990b6d2ef3eef976ca3b77cf712b5dfaa038677ca796ef59267c522c3a878
3
+ metadata.gz: df772a60961a47e57f4904ffd9b813add5a6d4477a07834eb4f177fb25eb536a
4
+ data.tar.gz: 2a7225798390df7f5ed428092803e3e3d4facf31900bc9085f8cdda2b61122fd
5
5
  SHA512:
6
- metadata.gz: 4e6e9f6f3a57344ffa8d730d0025977f541a38881559899b0944f1c7658fd306b03f8e5942eb84a114368075597c4c813fc82def9e692ffba56070d844146bd4
7
- data.tar.gz: 911d733c2665c9cf708fe1f65c11131973b1693321b3404cf1cf403f79a120ef6f6bbb9db79089d0b7bcaa4e9b1d6bfdc628762c0670334273e8f5d918dd636c
6
+ metadata.gz: 45e87f2067c2370748eb96d9929d133b8ccacdf724c100823cbf6a6a3374ad53b106f7d04742a0aee1e3bd6700668d49d0dc89285536b482c42fa580c788abbf
7
+ data.tar.gz: 907efaa1b66452cd63c43f36176a07462b0a7f4061196567aaa8b75fe572db0bf230245900488722b8acc39f7084b1abd968533e048607e15e6898ffe7ef935f
data/.gitignore CHANGED
@@ -10,6 +10,8 @@ Gemfile.lock
10
10
  # build artifacts
11
11
  *.gem
12
12
  /.bundle/
13
+ /.vscode
14
+ .solargraph.yml
13
15
  /vendor/bundle
14
16
  /spec/reports/
15
17
  /tmp/
data/.rubocop.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  AllCops:
2
- TargetRubyVersion: 3.2.2
2
+ TargetRubyVersion: 3.2
3
3
  NewCops: enable
4
4
 
5
5
  Metrics/ClassLength:
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.3] - 2025-02-xx
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 if type_coercion == FalseClass
182
- args = block_extra_args.dup.unshift(value)
183
-
184
- original_block&.call(*args)
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>[\w_-]*).*?$/
7
- BOOLEAN_ARGUMENT = /(?:^|--)no-(?<option>[\w_-]*).*?$/
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(*super(argv, &results_collector(results, &middleware)))
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.
@@ -1,3 +1,3 @@
1
1
  class RakeCommander
2
- VERSION = '0.4.2'.freeze
2
+ VERSION = '0.4.3'.freeze
3
3
  end
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.2
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: 2025-02-26 00:00:00.000000000 Z
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: 3.5.23
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.