rake-commander 0.2.6 → 0.2.10

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: ba9099907341e84e8420c7df7eca7f1b8f5279e454f73e031f01f982285ff583
4
- data.tar.gz: 5263523e7800afd7a1a172eeafb5ae65e48a5b535c0ec6467b52656b90778c58
3
+ metadata.gz: e78481443a21eacbeddb2075f3b483b272a12b62097313934783b36d97666fc6
4
+ data.tar.gz: 4ba805e5fe073aa4ac10d856360364a6c0ab3e0a03bb30cec88f66bb9fed63f6
5
5
  SHA512:
6
- metadata.gz: a5bdc0bcd00a882f0526e354f0a9a39b6efb0864748ffc088409ba7c2759f01ea2001d4f6eced4f56aaad2976d2ae5874a059e4e1cf434488243242e426444dd
7
- data.tar.gz: 4fe1f53c6885a8b35b2193d96313c0f2e570cff131285def889a425110b8743a3fb792b2e7ae5646514870bfe15055cf529a0e49020219e5032f97a3f1315f96
6
+ metadata.gz: eed71d7885cf03d3eb4341936ddeb0c5a155fa2058a5f0cc4f0dbb0d0fdfb20b3effee5c0671f07070b79025e031192f9e3150e389e478d768d92892de046237
7
+ data.tar.gz: cb696bb18618c2b547a7d3708d66ff54aa6011cd60e7e40e91f01b617e5ee7a5e7e5146ccbfd453070513faf0baac608383fe9deaf80a264bf3cfd2dcc9491e3
data/CHANGELOG.md CHANGED
@@ -32,12 +32,22 @@ 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.7] - 2023-05-xx
35
+ ## [0.2.11] - 2023-05-xx
36
36
 
37
37
  ### Added
38
38
  ### Fixed
39
39
  ### Changed
40
- - `RakeCommander::Option` configure_other should only apply when the instance vars are not defined.
40
+
41
+ ## [0.2.10] - 2023-05-01
42
+
43
+ ### Fixed
44
+ - `RakeCommander::Options` clean `options_hash` inheritance.
45
+
46
+
47
+ ## [0.2.7] - 2023-05-01
48
+
49
+ ### Fixed
50
+ - `RakeCommander::Option#desc` when fetching from other, should not fetch array but single value.
41
51
 
42
52
  ## [0.2.6] - 2023-05-01
43
53
 
@@ -236,16 +236,15 @@ class RakeCommander
236
236
 
237
237
  def fetch_type_from_other
238
238
  return nil unless type = other_args.find {|arg| arg.is_a?(Class)}
239
- @type_coercion ||= type
240
239
  other_args.delete(type)
241
240
  end
242
241
 
243
242
  def fetch_desc_from_other
244
243
  return nil unless value = other_args.find {|arg| arg.is_a?(String)}
245
- @desc ||= value
246
244
  other_args.dup.each do |val|
247
245
  other_args.delete(val) if val.is_a?(String)
248
246
  end
247
+ value
249
248
  end
250
249
  end
251
250
  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.6'.freeze
2
+ VERSION = '0.2.10'.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.6
4
+ version: 0.2.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oscar Segura Samper