shellopts 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/shellopts/argument_type.rb +3 -3
- 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: 013afe67b6f86e17d37bfbd1b18f3b4b7e7e5026d3249900326b23d1ed75ed95
|
4
|
+
data.tar.gz: 7ccfcca5ef44d9958e3f03ea23ea211893357ff32c7c5e5fdc4953ec61548306
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a50d291b69952d04bc054ea09cf292f6df414a4d6e1df69ac47cb3d2489626301c7eba4f66edd268f1c486463d6c37a1fd0b3cd431060c7100da980272c2b9e
|
7
|
+
data.tar.gz: 0bd422a52a4b11f69ade0d744df2a0bf8db6a05d67e282bfadb6a1a72af6f1ebe21ec0dd24b8ce663379d9e69db643036606e2fc1e502995e24f2f7b5c8bdea3
|
@@ -14,8 +14,8 @@ module ShellOpts
|
|
14
14
|
# safe for concurrent processing
|
15
15
|
attr_reader :message
|
16
16
|
|
17
|
-
# Return true if .value is an "instance" of self
|
18
|
-
#
|
17
|
+
# Return true if .value is an "instance" of self. Ie. an Integer object
|
18
|
+
# if type is an IntegerArgument
|
19
19
|
def value?(value) true end
|
20
20
|
|
21
21
|
# Convert value to Ruby type
|
@@ -131,7 +131,7 @@ module ShellOpts
|
|
131
131
|
class EnumArgument < ArgumentType
|
132
132
|
attr_reader :values
|
133
133
|
def initialize(values) @values = values.dup end
|
134
|
-
def match?(name, literal)
|
134
|
+
def match?(name, literal) value?(literal) or set_message "Illegal value in #{name}: '#{literal}'" end
|
135
135
|
def value?(value) @values.include?(value) end
|
136
136
|
end
|
137
137
|
end
|
data/lib/shellopts/version.rb
CHANGED