optparse-simple 0.2.9 → 0.2.10

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.
Files changed (2) hide show
  1. data/lib/optparse-simple.rb +6 -1
  2. metadata +2 -2
@@ -1,3 +1,7 @@
1
+ #!/usr/bin/ruby
2
+
3
+ # file: optparse-simple.rb
4
+
1
5
  require 'rexml/document'
2
6
  require 'table-formatter'
3
7
  include REXML
@@ -56,7 +60,8 @@ class OptParseSimple
56
60
  args.compact!
57
61
  # -- end of bind any loose value to their argument
58
62
 
59
- a1 = options_match(@options[0], args).flatten.each_slice(2).map {|x| x if x[0]}.compact
63
+ a1 = []
64
+ a1 = options_match(@options[0], args).flatten.each_slice(2).map {|x| x if x[0]}.compact unless @options.empty?
60
65
  options_remaining = XPath.match(@doc.root, 'records/option/summary[switch=""]/name/text()')
61
66
  a2 = args.zip(options_remaining).map(&:reverse)
62
67
  if a2.map(&:first).all? then
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: optparse-simple
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.9
4
+ version: 0.2.10
5
5
  platform: ruby
6
6
  authors: []
7
7
 
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-07-04 00:00:00 +01:00
12
+ date: 2010-07-09 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies: []
15
15