config_parser 0.5.1 → 0.5.2

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/History CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.5.2 / 2010-11-27
2
+
3
+ * fixed sorting of mixed long and short options
4
+
1
5
  == 0.5.1 / 2010-11-21
2
6
 
3
7
  * added guessing of hints
data/lib/config_parser.rb CHANGED
@@ -102,10 +102,10 @@ class ConfigParser
102
102
  end
103
103
 
104
104
  # Sorts options in the registry as specified by the block. Groups of
105
- # options as delimited by separators are sorted independently. If no
106
- # block is given, options are sorted by their long and short keys.
105
+ # options as delimited by separators are sorted independently. If no block
106
+ # is given, options are sorted by their long and short keys.
107
107
  def sort_opts!(&block)
108
- block ||= lambda {|option| option.long || option.short }
108
+ block ||= lambda {|option| (option.long || option.short).to_s.sub(/^-+/, '') }
109
109
 
110
110
  splits = []
111
111
  current = []
@@ -1,7 +1,7 @@
1
1
  class ConfigParser
2
2
  MAJOR = 0
3
3
  MINOR = 5
4
- TINY = 1
4
+ TINY = 2
5
5
 
6
6
  VERSION = "#{MAJOR}.#{MINOR}.#{TINY}"
7
7
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: config_parser
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 15
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 1
10
- version: 0.5.1
9
+ - 2
10
+ version: 0.5.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Simon Chiang
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-21 00:00:00 -07:00
18
+ date: 2010-11-27 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency