clasp-ruby 0.20.0 → 0.20.1

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: 2e7715986763c851922433b19a5b08fd761f700bf9b65dfaf74c338e105d3188
4
- data.tar.gz: 998e0fe0365c4ca7b11d2ae29269ea5d84fbf3cb65bab70cbe590072a339250c
3
+ metadata.gz: f92b789f37af02b75b9644ff0d68c2f8dc1fb37bed7372f85a2e3076bda3318c
4
+ data.tar.gz: 915b038fa26a675ff5adef533286ed89dd1637cab521d9d187eb2cc28eb60405
5
5
  SHA512:
6
- metadata.gz: ea17e88ca07b892f2e20083e63c2973eb8c3d11a66a0d02f338b57dde312e807189178cc603fd1d4965fc53189656734ea024ade3d6229c7f4c438cfa1168de9
7
- data.tar.gz: 5ca6e41aa2757ae84a8824737aae0d0baac6654c0c7b026f7c4159d0ad2edc8766643216d1e9448f53f6a2c10f5b9759988d289d803911889c8534e4ac34a0b0
6
+ metadata.gz: 14b4ed81618a5564af21068ed04f8443cb0e699763f3489d91deae285bf3e7b2e5a8b77e0331185cec751659772ddd6d54a3a93ac1ee98aaf05f0a11c12d78b4
7
+ data.tar.gz: 90b82b5a6b1553c540f8904dbc4c2b3fe7257a0c177fbb4cacc4004af9e46470f5f0af8e119a635cf25062ab1b41a7bee54c9c4a512e74a48807b9cda4da4779
@@ -491,6 +491,17 @@ class Arguments
491
491
 
492
492
  resolved_name = "#$1#$2"
493
493
  value ||= $'
494
+
495
+ # now find the underlying (option) specification
496
+ specifications.each do |t|
497
+
498
+ if t.name == resolved_name or t.aliases.include? resolved_name
499
+
500
+ argument_spec = t
501
+
502
+ break
503
+ end
504
+ end
494
505
  end
495
506
 
496
507
  break
@@ -97,7 +97,7 @@ class FlagSpecification
97
97
  case rhs
98
98
  when self.class
99
99
 
100
- ;
100
+ return true if equal?(rhs)
101
101
  else
102
102
 
103
103
  return false
@@ -230,7 +230,7 @@ class OptionSpecification
230
230
  case rhs
231
231
  when self.class
232
232
 
233
- ;
233
+ return true if equal?(rhs)
234
234
  else
235
235
 
236
236
  return false
@@ -241,7 +241,7 @@ class OptionSpecification
241
241
  return false unless help == rhs.help
242
242
  return false unless values_range == rhs.values_range
243
243
  return false unless default_value == rhs.default_value
244
- return false unless required == rhs.required
244
+ return false unless required? == rhs.required?
245
245
  return false unless required_message == rhs.required_message
246
246
  return false unless extras == rhs.extras
247
247
 
@@ -51,7 +51,7 @@
51
51
  module CLASP
52
52
 
53
53
  # Current version of the CLASP.Ruby library
54
- VERSION = '0.20.0'
54
+ VERSION = '0.20.1'
55
55
 
56
56
  private
57
57
  VERSION_PARTS_ = VERSION.split(/[.]/).collect { |n| n.to_i } # :nodoc:
@@ -518,6 +518,7 @@ class Test_Arguments < Test::Unit::TestCase
518
518
  assert_equal '-o', args.options[0].given_name
519
519
  assert_equal 1, args.options[0].given_hyphens
520
520
  assert_equal Hash.new, args.options[0].extras
521
+ assert_equal specifications[0], args.options[0].argument_specification
521
522
 
522
523
  assert_equal 1, args.values.size
523
524
  assert_equal 'value1', args.values[0]
@@ -541,6 +542,7 @@ class Test_Arguments < Test::Unit::TestCase
541
542
  assert_equal Hash.new, args.flags[0].extras
542
543
 
543
544
  assert_equal 3, args.options.size
545
+ assert_equal 2, args.options[0].given_index
544
546
  assert_equal '--option=value', args.options[0].to_s
545
547
  assert_equal '--option', args.options[0].name
546
548
  assert_equal 'o', args.options[0].given_label
@@ -548,6 +550,8 @@ class Test_Arguments < Test::Unit::TestCase
548
550
  assert_equal '-o', args.options[0].given_name
549
551
  assert_equal 1, args.options[0].given_hyphens
550
552
  assert_equal Hash.new, args.options[0].extras
553
+ assert_equal specifications[0], args.options[0].argument_specification
554
+ assert_equal 4, args.options[1].given_index
551
555
  assert_equal '--option=special-value', args.options[1].to_s
552
556
  assert_equal '--option', args.options[1].name
553
557
  assert_equal 's', args.options[1].given_label
@@ -555,6 +559,8 @@ class Test_Arguments < Test::Unit::TestCase
555
559
  assert_equal '-s', args.options[1].given_name
556
560
  assert_equal 1, args.options[1].given_hyphens
557
561
  assert_equal Hash.new, args.options[1].extras
562
+ assert_equal specifications[0], args.options[1].argument_specification
563
+ assert_equal 5, args.options[2].given_index
558
564
  assert_equal '--option=explicit-value', args.options[2].to_s
559
565
  assert_equal '--option', args.options[2].name
560
566
  assert_equal 's', args.options[2].given_label
@@ -562,6 +568,7 @@ class Test_Arguments < Test::Unit::TestCase
562
568
  assert_equal '-s', args.options[2].given_name
563
569
  assert_equal 1, args.options[2].given_hyphens
564
570
  assert_equal Hash.new, args.options[2].extras
571
+ assert_equal specifications[0], args.options[2].argument_specification
565
572
 
566
573
  assert_equal 1, args.values.size
567
574
  assert_equal 'value1', args.values[0]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clasp-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.20.0
4
+ version: 0.20.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Wilson