cliutils 2.1.3 → 2.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/HISTORY.md +4 -0
- data/lib/cliutils/constants.rb +1 -1
- data/lib/cliutils/prefs/pref_validators/time_validator.rb +3 -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: d62e541400b381493e5a6699ba4db68e959cdc06
|
4
|
+
data.tar.gz: 2e733795f7de8268159811bd1a457e21066575f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a600e5780fccddf0d6d86031e383085b3f07d971ab8378de2d1ef0544bdb85f6846ae6fe9ad0348602eb8b0381efe1b81316bff5c3531ef20faffd4e26469dfe
|
7
|
+
data.tar.gz: d305f17fa6e613e0ab963f32103e333386977af6f1382379de9011fc4b527b5d9c518d50e104fad5951d0fff9d99e756872927d71ccb92e79b4839fe4482d7d2
|
data/HISTORY.md
CHANGED
data/lib/cliutils/constants.rb
CHANGED
@@ -6,7 +6,9 @@ module CLIUtils
|
|
6
6
|
# @param [Object] text The "text" to evaluate
|
7
7
|
# @return [String]
|
8
8
|
def validate(text)
|
9
|
-
|
9
|
+
military_regex = '([01]?[0-9]|2[0-3])\:[0-5][0-9]'
|
10
|
+
regular_regex = "#{ military_regex }(\\s?[AaPp][Mm])?"
|
11
|
+
@is_valid = text.to_s =~ /^(#{ military_regex }|#{ regular_regex })$/
|
10
12
|
@message = "Response is not a time: #{ text }"
|
11
13
|
end
|
12
14
|
end
|