getopt-declare 1.12 → 1.13

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.
data/Declare.rdoc CHANGED
@@ -535,7 +535,7 @@
535
535
  # a specific parameter (or, alternatively, _all_ parameters) to be matched
536
536
  # case-insensitively.
537
537
  #
538
- # If a <tt>nocase]</tt> directive is included in the description of a
538
+ # If a <tt>[nocase]</tt> directive is included in the description of a
539
539
  # specific parameter variant, then that variant (only) will be matched
540
540
  # without regard for case. For example, the specification:
541
541
  #
data/HISTORY.txt CHANGED
@@ -1,3 +1,8 @@
1
+ 1.13 - Fixed bug that would always match parameters in a case insensitive
2
+ way, as if [nocase] had been used. This should speed the parser a
3
+ tiny bit.
4
+
5
+ [cluster: ...] was incorrectly being printed in help usage.
1
6
 
2
7
  1.12 - Fixed bug with :+i, :+n, :0+i options not being cast appropiately
3
8
  when used in pvttypes.
@@ -2,9 +2,9 @@ require "rubygems"
2
2
 
3
3
  spec = Gem::Specification.new do |spec|
4
4
  spec.name = "getopt-declare"
5
- spec.version = '1.12'
6
- spec.author = "Gonzalo Garramuno"
7
- spec.email = 'GGarramuno@aol.com'
5
+ spec.version = '1.13'
6
+ spec.author = "Gonzalo Garramuno"
7
+ spec.email = 'ggarra@advancedsl.com.ar, GGarramuno@aol.com'
8
8
  spec.homepage = 'http://www.rubyforge.org/projects/getoptdeclare/'
9
9
  spec.summary = 'Getopt-Declare is a command-line argument parser.'
10
10
  spec.require_path = "lib"
@@ -61,7 +61,7 @@ end
61
61
 
62
62
  # Regex for removing bracket directives
63
63
  BracketDirectives =
64
- /\[(?:ditto|tight|strict|repeatable|debug|required|mutex:.*|implies:.*|excludes:.*|requires:.*)\]/
64
+ /\[(?:ditto|tight|strict|repeatable|debug|required|mutex:.*|implies:.*|excludes:.*|requires:.*|cluster:.*)\]/
65
65
 
66
66
 
67
67
  module Getopt
@@ -382,7 +382,7 @@ EOS
382
382
 
383
383
  # Return string with code to cache array in Getopt::Declare's cache
384
384
  def cachecode(ownerflag, itemcount)
385
- if ( itemcount > 1 )
385
+ if itemcount > 1
386
386
  " @cache['#{ownerflag}']['<#{@name}>'] = [] unless @cache['#{ownerflag}']['<#{@name}>']
387
387
  @cache['#{ownerflag}']['<#{@name}>'] = #{@name}\n"
388
388
  else
@@ -608,7 +608,7 @@ EOS
608
608
  flag = @flag
609
609
  clump = owner.clump
610
610
  i = 0
611
- nocase = (Getopt::Declare::_nocase() || @nocase ? 'i' : '')
611
+ nocase = ((Getopt::Declare::_nocase() || @nocase) ? 'i' : '')
612
612
 
613
613
  code << " catch(:paramout) do\n"
614
614
  code += (!@repeatable) ? " while !_FOUND_['" + name() + "']" :
@@ -744,8 +744,8 @@ EOS
744
744
 
745
745
  # Check if global ignore case in regex is defined
746
746
  def Declare._nocase(*t)
747
- @@_nocase = t[0] if t[0]
748
- @@_nocase
747
+ @@nocase = t[0] if t[0]
748
+ @@nocase
749
749
  end
750
750
 
751
751
  #
@@ -851,9 +851,9 @@ EOS
851
851
 
852
852
  if desc =~ /\[no\s*case\]/i
853
853
  if arg
854
- arg.nocase = 1 #should it be _nocase
854
+ arg.nocase = true #should it be _nocase
855
855
  else
856
- _nocase( 1 )
856
+ _nocase( true )
857
857
  end
858
858
  end
859
859
 
@@ -993,7 +993,7 @@ EOS
993
993
  _strict = false
994
994
  _all_repeatable = false
995
995
  _lastdesc = nil
996
- Getopt::Declare::_nocase( 0 )
996
+ Getopt::Declare::_nocase( false )
997
997
  Getopt::Declare::ScalarArg::_reset_stdtype()
998
998
 
999
999
  # CONSTRUCT GRAMMAR
@@ -1223,7 +1223,7 @@ EOS
1223
1223
  end
1224
1224
 
1225
1225
 
1226
- @@_nocase = 0
1226
+ @@nocase = false
1227
1227
 
1228
1228
 
1229
1229
  # Print out version information and maybe exit
@@ -1634,6 +1634,12 @@ end
1634
1634
  end
1635
1635
  end
1636
1636
 
1637
+ # Operator to return number of flags set
1638
+ def size
1639
+ return 0 unless @cache
1640
+ return @cache.keys.size
1641
+ end
1642
+
1637
1643
  attr :mutex
1638
1644
  attr :helppat
1639
1645
  attr :verspat
metadata CHANGED
@@ -1,62 +1,68 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.8.1
2
+ rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: getopt-declare
5
5
  version: !ruby/object:Gem::Version
6
- version: "1.12"
7
- date: 2005-07-17
6
+ version: "1.13"
7
+ date: 2006-05-17 00:00:00 -03:00
8
8
  summary: Getopt-Declare is a command-line argument parser.
9
9
  require_paths:
10
- - lib
11
- author: Gonzalo Garramuno
12
- email: GGarramuno@aol.com
10
+ - lib
11
+ email: ggarra@advancedsl.com.ar, GGarramuno@aol.com
13
12
  homepage: http://www.rubyforge.org/projects/getoptdeclare/
14
13
  rubyforge_project: getoptdeclare
15
- description: "Comprehensive and easy to use command-line parser library using regular
16
- expressions. Port of Conway's Perl Getopt-Declare."
14
+ description: Comprehensive and easy to use command-line parser library using regular expressions. Port of Conway's Perl Getopt-Declare.
17
15
  autorequire: Getopt/Declare
18
16
  default_executable:
19
17
  bindir: bin
20
18
  has_rdoc: false
21
19
  required_ruby_version: !ruby/object:Gem::Version::Requirement
22
20
  requirements:
23
- -
24
- - ">="
25
- - !ruby/object:Gem::Version
26
- version: 1.6.8
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 1.6.8
27
24
  version:
28
25
  platform: ruby
26
+ signing_key:
27
+ cert_chain:
28
+ authors:
29
+ - Gonzalo Garramuno
29
30
  files:
30
- - lib/Getopt/Declare.rb
31
- - lib/Getopt/DelimScanner.rb
32
- - Declare.rdoc
33
- - HISTORY.txt
34
- - getoptdeclare.gemspec
31
+ - lib/Getopt/Declare.rb
32
+ - lib/Getopt/DelimScanner.rb
33
+ - Declare.rdoc
34
+ - HISTORY.txt
35
+ - getoptdeclare.gemspec
35
36
  test_files:
36
- - samples/cmdline_basic.rb
37
- - samples/cmdline_mid.rb
38
- - samples/cmdline_parameters.rb
39
- - samples/cmdline_regex.rb
40
- - samples/cmdline_pvtype.rb
41
- - samples/cmdline_code.rb
42
- - samples/cmdline_pvtype2.rb
43
- - samples/cmdline_file.rb
44
- - samples/demo_csv.rb
45
- - samples/demo_shell.rb
46
- - samples/demo_interp.rb
47
- - samples/demo_cmdline.rb
48
- - samples/cmdline_noargv.rb
49
- - samples/cmdline_array.rb
50
- - samples/cmdline_defer.rb
51
- - samples/cmdline_singles.rb
52
- - samples/cmdline_inlines.rb
53
- - samples/cmdline_finish.rb
37
+ - samples/cmdline_basic.rb
38
+ - samples/cmdline_mid.rb
39
+ - samples/cmdline_parameters.rb
40
+ - samples/cmdline_regex.rb
41
+ - samples/cmdline_pvtype.rb
42
+ - samples/cmdline_code.rb
43
+ - samples/cmdline_pvtype2.rb
44
+ - samples/cmdline_file.rb
45
+ - samples/demo_csv.rb
46
+ - samples/demo_shell.rb
47
+ - samples/demo_interp.rb
48
+ - samples/demo_cmdline.rb
49
+ - samples/cmdline_noargv.rb
50
+ - samples/cmdline_array.rb
51
+ - samples/cmdline_defer.rb
52
+ - samples/cmdline_singles.rb
53
+ - samples/cmdline_inlines.rb
54
+ - samples/cmdline_finish.rb
54
55
  rdoc_options: []
56
+
55
57
  extra_rdoc_files:
56
- - Declare.rdoc
57
- - HISTORY.txt
58
- - getoptdeclare.gemspec
58
+ - Declare.rdoc
59
+ - HISTORY.txt
60
+ - getoptdeclare.gemspec
59
61
  executables: []
62
+
60
63
  extensions: []
64
+
61
65
  requirements: []
62
- dependencies: []
66
+
67
+ dependencies: []
68
+