cliswitch 0.2.0 → 0.2.1

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 (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/cliswitch.rb +8 -6
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fac5855b05250df32e5b0fa38dc7604d627e2180de6e903ef7d85b2bf07b5170
4
- data.tar.gz: 40061dedc6efab12c0cbc7267968df72324f9df5b20347822969c3a7e2298d74
3
+ metadata.gz: 5f884b75767f531b219206e74ae7ecaceea9fc9b6605f0ddc08175283447e497
4
+ data.tar.gz: ef07f732a488e51e9483a903c70c089df190018f0919aebed8ee33856654cb80
5
5
  SHA512:
6
- metadata.gz: 1b341ee0cf2f45820ab9bafe32732f8f2412d84d3c0d13569c33139ad5179a68a96ffd168a31891e3f2f6e523c5ffa51ea0f9a58a53588d0d923e2e144f0cb9f
7
- data.tar.gz: 75abc379c73d03d463fe580702df5c4431e5dba6b466d51455e9f9cc6eb546b8fae310a9d63593a11788da74193aee2811e36a691b7fe47ca53554835cce34ce
6
+ metadata.gz: 564f3153be079f12cda33df74bbe9b0aedd6166fbd36df55ea4f803189564adc407a34daa84c8195720a2da6d883f705fb1c7f273ce1768cd16efadc6da41498
7
+ data.tar.gz: 426f9e35c603935b9d04d71156a581460b4287e957dc4c727d4d3c061614858550783d4e219a34a4365cf0db6936dbe48f780c72f70eb92864a4ce2fa2cb6ede
data/lib/cliswitch.rb CHANGED
@@ -12,7 +12,7 @@
12
12
 
13
13
  class CliSwitch
14
14
 
15
- VERSION = "0.2.0"
15
+ VERSION = "0.2.1"
16
16
 
17
17
  class Option
18
18
  attr_accessor :name,
@@ -103,11 +103,13 @@ class CliSwitch
103
103
  arr.delete_at(_2+1)
104
104
  when 'optional'
105
105
  next_arg = arr[_2 + 1]
106
- if next_arg.start_with?('-') && search_in_options_config(next_arg)
107
- # do nothing
108
- else
109
- op.next_arg = next_arg
110
- arr.delete_at(_2+1)
106
+ if !next_arg.nil?
107
+ if next_arg.start_with?('-') && search_in_options_config(next_arg)
108
+ # do nothing
109
+ else
110
+ op.next_arg = next_arg
111
+ arr.delete_at(_2+1)
112
+ end
111
113
  end
112
114
  when 'noarg'
113
115
  # do nothing
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cliswitch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ccmywish