shellopts 2.0.15 → 2.0.16
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/lib/shellopts/program.rb +4 -4
- data/lib/shellopts/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 256d4f5a28f8f4028030ac17631d4e93a36584b77c96cd8090ecab8dc393f36f
|
4
|
+
data.tar.gz: 381c0515800feb0a4d2327d336ed35c43e5441915cf6aef5cb4ebd365cbe8d39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac3af229c984160970034b5bbef21584bb5d78e6581f3efb2d4d9c10e9217ebde1e3cc248136224c4859d9a73ded08fc1a6782ebddb55a2d8eff1b5d480c42f9
|
7
|
+
data.tar.gz: 855d30fcd66f441a09ab53d50284a11e2a24bcd8c24b9c5573e1783c571005ab6b7a383aefbd0d9883893207550fe9bd880def44e361f000c87289a3476fe48f
|
data/lib/shellopts/program.rb
CHANGED
@@ -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
|
-
@
|
104
|
+
self.to_h(@__grammar__.options.map(&:ident))
|
105
105
|
else
|
106
106
|
keys.map { |key|
|
107
|
-
|
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
|
159
|
-
#
|
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
|
data/lib/shellopts/version.rb
CHANGED