optparshie 1.2.1 → 1.2.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/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.1
1
+ 1.2.2
data/example/example1.rb CHANGED
@@ -13,6 +13,9 @@ opt.on("-o","--on");
13
13
  opt.on("--[no-]foo");
14
14
  opt.on("--[no-]bar");
15
15
 
16
+ # help
17
+ puts("opt.help =>\n#{opt.help}");
18
+
16
19
  # parse returns mash
17
20
  puts("opt.parse => #{opt.parse(argv)}");
18
21
  # parse! returns [argv, mash]
data/lib/optparshie.rb CHANGED
@@ -15,6 +15,7 @@ class OptionParshie < OptionParser
15
15
  end
16
16
 
17
17
  def hash_key_sanitize(switch)
18
+ switch = switch.dup();
18
19
  switch.gsub!(/^--\[no-\]/,"--");
19
20
  switch.gsub!(/^-+/,"")
20
21
  switch.gsub!(/\W/,"_");
@@ -70,7 +71,7 @@ class OptionParshie < OptionParser
70
71
  # ------------------------------------------------------------------
71
72
  # optparshie code by l.p.m.11
72
73
  # ------------------------------------------------------------------
73
- hash_sw_add(sw,val);
74
+ hash_sw_add(sw, val);
74
75
 
75
76
  val = cb.call(val) if cb
76
77
  setter.call(sw.switch_name, val) if setter
@@ -106,7 +107,7 @@ class OptionParshie < OptionParser
106
107
  # ------------------------------------------------------------------
107
108
  # optparshie code by l.p.m.11
108
109
  # ------------------------------------------------------------------
109
- hash_sw_add(sw,val);
110
+ hash_sw_add(sw, val);
110
111
 
111
112
  argv.unshift(opt) if opt and (!rest or (opt = opt.sub(/\A-*/, '-')) != '-')
112
113
  val = cb.call(val) if cb
data/optparshie.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "optparshie"
8
- s.version = "1.2.1"
8
+ s.version = "1.2.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["lpm11"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: optparshie
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -95,7 +95,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
95
95
  version: '0'
96
96
  segments:
97
97
  - 0
98
- hash: -3077249028836579576
98
+ hash: -2890419790334627916
99
99
  required_rubygems_version: !ruby/object:Gem::Requirement
100
100
  none: false
101
101
  requirements: