opt_parse_validator 0.0.12 → 0.0.12.1
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/opt_parse_validator/opts/choice.rb +3 -3
- data/lib/opt_parse_validator/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1209eb7a2eef65f85a84150ba8214a3b5357190
|
4
|
+
data.tar.gz: 40e4a3c671bbe2dba9f4c61eed03c8d96366c558
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a77296172e928048d89ef685da148edd360cd35635f985425bd4aadd379a92b7fd8f97cd51fbd8c22700251487c311998db3479fc2ce808c747c71a46fe0e5e4
|
7
|
+
data.tar.gz: cbeeca877fffb10c99ed4436591a586c9a1ac714de0096518cb69012fe5700f17db18eeddb71c80bd59d502e6096dc252d7d7a4bce06b96848cd86bcb48bac3d
|
@@ -17,7 +17,7 @@ module OptParseValidator
|
|
17
17
|
msg = 'Available choices:'
|
18
18
|
|
19
19
|
choices.each do |choice|
|
20
|
-
msg += choice.to_s == default ? " #{choice} (default)," : " #{choice},"
|
20
|
+
msg += choice.to_s == default.to_s ? " #{choice} (default)," : " #{choice},"
|
21
21
|
end
|
22
22
|
|
23
23
|
option << msg[0..-2]
|
@@ -34,8 +34,8 @@ module OptParseValidator
|
|
34
34
|
choices.map!(&:downcase)
|
35
35
|
end
|
36
36
|
|
37
|
-
fail Error,
|
38
|
-
|
37
|
+
fail Error, "'#{value}' is not a valid choice, expected one " \
|
38
|
+
"of the followings: #{choices.join(',')}" unless choices.include?(value)
|
39
39
|
|
40
40
|
value
|
41
41
|
end
|