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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1e7c51a5d7ef46991d57c770ec2ea085618afac9
4
- data.tar.gz: 0df2427adc39fb0e7af3aee0db9f24786fb05e6f
3
+ metadata.gz: b4356b32d38251a6d9944f9b76cb4f67082c871c
4
+ data.tar.gz: d6f981ffc6296a2c4ea58ce98f02e62f59a985eb
5
5
  SHA512:
6
- metadata.gz: bbab6b6240755ff1606a927f484007ef575ff6141966c489e0626fd2316596c071f1bc54bf66f626e05f926c2ee3244174d77c72b92131ed77738e34eb0afcc1
7
- data.tar.gz: 17d347012c595802087bfa0114ee4612488f0a804e52d89d35eaa92d1dde6d89ad7a514fd86845caa7cfb5569d34f4e3fc4bb66370c426a4a76536b0b4699742
6
+ metadata.gz: 5c01afa32bb8a831976300d085c554139f2a93acc171c4df0dd71a94604e16c33a404b1db093c016bc0d31a304522b1d74b5dadd92497c1f62001e8dee84c85f
7
+ data.tar.gz: fecba5909fb7c7cbfd64573f0b90648dc4e59d06e176934e4454e319b307e050ee751248f4f13aa44798b9a0fcf534585b431e16b6915fc00be107f871418eeb
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 0.3.2
2
+
3
+ * Fix handling of blanks as array arguments
4
+
5
+ *Pavol Zbell*
6
+
1
7
  ## 0.3.1
2
8
 
3
9
  * Fix critical bug when parsing arguments
@@ -1,3 +1,3 @@
1
1
  module OptBind
2
- VERSION = '0.3.1'
2
+ VERSION = '0.3.2'
3
3
  end
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.1
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-07 00:00:00.000000000 Z
11
+ date: 2016-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec