cli-dispatcher 1.2.5 → 1.2.6

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: b1b37219d472cc73b55f56047050b442e634de6b08c649dc617c12c0e812f220
4
- data.tar.gz: 1cf08e0e3893984ef5d15c414d87b0889c3073dea6d7a6e8d7a6c6b12889d181
3
+ metadata.gz: be7440d7ccb3b1dfd9b90eae4b32d62597a864e4dd6676deaf9dc36e08d08470
4
+ data.tar.gz: 3338fab7655d4074368786f822ffac62c9b12d3e74ea98ef7bc554f44b248e93
5
5
  SHA512:
6
- metadata.gz: 593cce73a3bd60c69bcad822f1dcb20579f482eec9454ce86bd9164da88ff0f536cebdd67fbf55695c88622e3c391ece18bff6a12e8ad18f094d2cabee45308c
7
- data.tar.gz: da5e84b8318b15d2510ac1a04086a66bd8a53689bb2afb59a9afa4d893f3380554702ecebdc55f88805002a8e81f15377767711cc16f17bb33d386624ea08724
6
+ metadata.gz: 16e45a2046ebbd9679789549b53e15afb4b4cd556bf1857feb25e61c4d90f55a4bb4d555f242fc66af926550566aa4e75fcf5bd693133475c00070ffbc102b91
7
+ data.tar.gz: 2f09de799fcca6242233880aa6452abf600e3d179f6ddd7b9b3d03747980d327e68e56cb8609264c3ac7b29397f5285d2264c4b96ef55c5d1eb4c74e05a26cb0
@@ -227,12 +227,16 @@ class Dispatcher
227
227
  end
228
228
 
229
229
 
230
- # Receives options, passing them to OptionParser. The options are processed
231
- # when dispatch_argv is called. The usage of this method is that after the
232
- # Dispatcher object is created, this method is called to instantiate the
233
- # options for the class. See #add_options for another way of doing this.
234
230
  #
235
- # The banner and -h/--help options will be added automatically.
231
+ # Creates an OptionParser object for this Dispatcher. The options for the
232
+ # OptionParser are defined in a block passed to this method. The block
233
+ # receives one argument, which is the OptionParser object being created.
234
+ #
235
+ # The banner and -h/--help options will be added automatically to the created
236
+ # OptionParser object.
237
+ #
238
+ # For a slightly simpler way to set up options for this Dispatcher object, see
239
+ # the add_options method.
236
240
  #
237
241
  def setup_options
238
242
  @option_parser = OptionParser.new do |opts|
@@ -241,10 +245,14 @@ class Dispatcher
241
245
  end
242
246
 
243
247
  #
244
- # Given an OptionParser object, add options. By default, this method does
245
- # nothing. The usage of this method, in contrast to #setup_options, is to
246
- # override this method, invoking calls to the +opts+ argument to add options.
247
- # The method will be called automatically when the Dispatcher is invoked.
248
+ # Adds command-line options for this class. By default, this method does
249
+ # nothing. Subclasses may override this method to add options. The method will
250
+ # be automatically invoked during a dispatch_argv call, thereby constructing
251
+ # an OptionParser object to handle the command-line arguments.
252
+ #
253
+ # The argument to this method is an OptionParser object, to which the desired
254
+ # options may be added. The banner and -h/--help options will be added
255
+ # automatically to the OptionParser object.
248
256
  #
249
257
  def add_options(opts)
250
258
  end
data/lib/structured.rb CHANGED
@@ -461,7 +461,7 @@ module Structured
461
461
  Structured.trace(key.to_s) do
462
462
  val = hash[key] || hash[key.to_s]
463
463
  cval = process_value(obj, val, data)
464
- apply_val(obj, key, cval) if cval
464
+ apply_val(obj, key, cval) unless cval.nil?
465
465
  end
466
466
  end
467
467
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cli-dispatcher
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.5
4
+ version: 1.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Charles Duan
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-10-02 00:00:00.000000000 Z
10
+ date: 2025-12-04 00:00:00.000000000 Z
11
11
  dependencies: []
12
12
  description: |
13
13
  Library for creating command-line programs that accept commands. Also
@@ -42,7 +42,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
42
42
  - !ruby/object:Gem::Version
43
43
  version: '0'
44
44
  requirements: []
45
- rubygems_version: 3.7.2
45
+ rubygems_version: 3.6.9
46
46
  specification_version: 4
47
47
  summary: Command-line command dispatcher
48
48
  test_files: []