optbind 0.3.1 → 0.3.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/optbind/version.rb +1 -1
- data/lib/optbind.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b4356b32d38251a6d9944f9b76cb4f67082c871c
|
|
4
|
+
data.tar.gz: d6f981ffc6296a2c4ea58ce98f02e62f59a985eb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5c01afa32bb8a831976300d085c554139f2a93acc171c4df0dd71a94604e16c33a404b1db093c016bc0d31a304522b1d74b5dadd92497c1f62001e8dee84c85f
|
|
7
|
+
data.tar.gz: fecba5909fb7c7cbfd64573f0b90648dc4e59d06e176934e4454e319b307e050ee751248f4f13aa44798b9a0fcf534585b431e16b6915fc00be107f871418eeb
|
data/CHANGELOG.md
CHANGED
data/lib/optbind/version.rb
CHANGED
data/lib/optbind.rb
CHANGED
|
@@ -212,8 +212,8 @@ class OptionBinder
|
|
|
212
212
|
@argument_definitions.each do |a|
|
|
213
213
|
default = (@bound_variables_with_defaults ||= {})[a[:variable]]
|
|
214
214
|
r = argv[0] ? argv.shift : default
|
|
215
|
-
r = ([r].flatten + argv.shift(argv.size)) if a[:opts].include? :MULTIPLE
|
|
216
|
-
@parser.abort 'missing arguments' if r.nil? && a[:opts].include?(:REQUIRED)
|
|
215
|
+
r = ([r].flatten + argv.shift(argv.size)).compact if a[:opts].include? :MULTIPLE
|
|
216
|
+
@parser.abort 'missing arguments' if (r.nil? || (r.is_a?(Array) && r.empty?)) && a[:opts].include?(:REQUIRED)
|
|
217
217
|
handle! a[:handler], r, a[:bound], a[:variable], default
|
|
218
218
|
return argv if a[:opts].include? :MULTIPLE
|
|
219
219
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: optbind
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Pavol Zbell
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-03-
|
|
11
|
+
date: 2016-03-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rspec
|