shellopts 2.0.15 → 2.0.16

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 253954c7f2de836c89e511dffabf3217719e778d47f74740a51c3b1099dcd07f
4
- data.tar.gz: 4a5579e3c56674d09ba380d392e600028e6c353728994e8b2445629b772cb450
3
+ metadata.gz: 256d4f5a28f8f4028030ac17631d4e93a36584b77c96cd8090ecab8dc393f36f
4
+ data.tar.gz: 381c0515800feb0a4d2327d336ed35c43e5441915cf6aef5cb4ebd365cbe8d39
5
5
  SHA512:
6
- metadata.gz: d0f0f0418361c69037a944c1e99021c32d578ed41dc239e7f9dc9f1ce94e578a137efdea3a9b96848fc0fb0b9aa1a8114153485b6ce21ceea7a3f34ceacdd197
7
- data.tar.gz: f70644b23103d244fe06164a337839c042d6e65e1aa3dba59fa6b028cf7b0032fd694121c582142f2f3cdfbdaa12cba17464b74114bc5caf5b2aa489cde94f9a
6
+ metadata.gz: ac3af229c984160970034b5bbef21584bb5d78e6581f3efb2d4d9c10e9217ebde1e3cc248136224c4859d9a73ded08fc1a6782ebddb55a2d8eff1b5d480c42f9
7
+ data.tar.gz: 855d30fcd66f441a09ab53d50284a11e2a24bcd8c24b9c5573e1783c571005ab6b7a383aefbd0d9883893207550fe9bd880def44e361f000c87289a3476fe48f
@@ -101,10 +101,10 @@ module ShellOpts
101
101
  def to_h(*keys)
102
102
  keys = ::Kernel::Array(keys).flatten
103
103
  if keys.empty?
104
- @__option_values__
104
+ self.to_h(@__grammar__.options.map(&:ident))
105
105
  else
106
106
  keys.map { |key|
107
- @__option_values__.key?(key) ? [key, @__option_values__[key]] : nil
107
+ self.__send__("#{key}?".to_sym) ? [key, self.__send__(key)] : nil
108
108
  }.compact.to_h
109
109
  end
110
110
  end
@@ -155,8 +155,8 @@ module ShellOpts
155
155
 
156
156
  # Hash from identifier to value. Can be Integer, Float, or String depending
157
157
  # on the option's type. Repeated options options without arguments have the
158
- # number of occurences as value and with arguments the value is an array of
159
- # the given values
158
+ # number of occurences as value, repeated option with arguments have the
159
+ # array of values as value
160
160
  attr_reader :__option_values__
161
161
 
162
162
  # List of Option objects for the subcommand in the same order as
@@ -1,3 +1,3 @@
1
1
  module ShellOpts
2
- VERSION = "2.0.15"
2
+ VERSION = "2.0.16"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shellopts
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.15
4
+ version: 2.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Claus Rasmussen