rake-commander 0.2.7 → 0.2.11

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: 40a9bf85b97c840145e1d31ef9370061f3ea967ceff7fe11ee3cc1b140b5e5fc
4
- data.tar.gz: 1d92bdaf2ea26fed4970ed218472e4229e636c0fe1c8ab76bd71dc45ea98586a
3
+ metadata.gz: '068822ca0ec4b9745dd946c64e851284cb4ebfb6103cc6d0f31dedac26247c7a'
4
+ data.tar.gz: 2e3978181bf2aaf9499275e31940faf95f0c7d8e6b62301dcd9ad26185cb8d4f
5
5
  SHA512:
6
- metadata.gz: 8dd47929f69e7574e16923ebd8a108e50b8b446cbdf20e83cedd1f2c2090d4df837d18d10a0c615cb2d66d42b67f6f541c483674fdc4b1dc580b29a7872f7150
7
- data.tar.gz: 38cefdecebbd1411e52d801e3d4113cda6f22834777dfa9492cd8a5794dcdf10100e22725cce47de11109e3b889a20dddbc1ef16e03702abbcd07a5291be8520
6
+ metadata.gz: a2087733ac4cf2c9c343e06fdb5b9674292df27469714f439ba1424eb7fdfb80f90113db74ae5ddbfddcd696a2455249e0a2abb8cfd30752fb4ca6ab5b4a0f6f
7
+ data.tar.gz: dad19cb129abb66464092887c8bc7845dc5268ab1df0cd409d8a86994d69af59e5e27fac41889338c617de015afbcaf53b481b863e0f0f76846ca6bf0913fa12
data/CHANGELOG.md CHANGED
@@ -32,12 +32,23 @@ All notable changes to this project will be documented in this file.
32
32
  - Option to globally enable/disable the 2nd patch?
33
33
  * That would make this gem completely useless.
34
34
 
35
- ## [0.2.8] - 2023-05-xx
35
+ ## [0.2.12] - 2023-05-xx
36
36
 
37
37
  ### Added
38
38
  ### Fixed
39
39
  ### Changed
40
40
 
41
+ ## [0.2.11] - 2023-05-01
42
+
43
+ ### Fixed
44
+ - When `RakeCommander::Option#type_coercion` is `FalseClass`, it should reverse the result.
45
+
46
+ ## [0.2.10] - 2023-05-01
47
+
48
+ ### Fixed
49
+ - `RakeCommander::Options` clean `options_hash` inheritance.
50
+
51
+
41
52
  ## [0.2.7] - 2023-05-01
42
53
 
43
54
  ### Fixed
@@ -151,7 +151,8 @@ class RakeCommander
151
151
  def option_block(&middleware)
152
152
  block_extra_args = [default, short, name, self]
153
153
  proc do |value|
154
- args = block_extra_args.dup.unshift(value)
154
+ value = !value if type_coercion == FalseClass
155
+ args = block_extra_args.dup.unshift(value)
155
156
  original_block&.call(*args)
156
157
  middleware&.call(*args)
157
158
  end
@@ -13,7 +13,12 @@ class RakeCommander
13
13
  base.extend RakeCommander::Base::ClassHelpers
14
14
  base.extend RakeCommander::Base::ClassInheritable
15
15
  base.extend ClassMethods
16
- base.attr_inheritable :banner, :options_hash
16
+ base.attr_inheritable :banner
17
+ base.attr_inheritable(:options_hash) do |value, subclass|
18
+ next nil unless value
19
+ value.values.uniq.each {|opt| subclass.send :add_to_options, opt}
20
+ subclass.send(:options_hash)
21
+ end
17
22
  base.class_resolver :option_class, RakeCommander::Option
18
23
  base.send :include, RakeCommander::Options::Result
19
24
  base.send :include, RakeCommander::Options::Error
@@ -198,6 +203,7 @@ class RakeCommander
198
203
  # @todo add `exception` parameter, to trigger an exception
199
204
  # when `opt` name or short are taken (and override is `false`)
200
205
  # @todo allow to specif if `:tail`, `:top` or `:base` (default)
206
+ # @note it is the unique access point to add an option.
201
207
  # @param opt [RakeCommander::Option] the option to be added.
202
208
  # @param override [Boolean] whether we should continue, may this action override (an)other option(s).
203
209
  # @return [RakeCommander::Option, NilClass] the option that was added, `nil` is returned otherwise.
@@ -1,3 +1,3 @@
1
1
  class RakeCommander
2
- VERSION = '0.2.7'.freeze
2
+ VERSION = '0.2.11'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rake-commander
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oscar Segura Samper