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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4bba979ecafccda1040055ca2a6f4d222cd2a531
4
- data.tar.gz: a56fa5d36b6b2b9a6cdf5c02385d874bfef9111c
3
+ metadata.gz: d62e541400b381493e5a6699ba4db68e959cdc06
4
+ data.tar.gz: 2e733795f7de8268159811bd1a457e21066575f5
5
5
  SHA512:
6
- metadata.gz: 08739e580db2ceb4718864d3d78d0c43b1bcd811eb372381b9f491ad6d15986fa6f5d8314a7acf17b99705bd1b7f5ba86a27b15b32a08c01417bf89ff9230147
7
- data.tar.gz: bccf0f6668b7c0e5b50a00b7043a49a3c3a32ae9a9cb76ace5b81f8d914575d8637a5ab031e9f2520b583032098a45179e72b8deea9311de9399e4584c730f01
6
+ metadata.gz: a600e5780fccddf0d6d86031e383085b3f07d971ab8378de2d1ef0544bdb85f6846ae6fe9ad0348602eb8b0381efe1b81316bff5c3531ef20faffd4e26469dfe
7
+ data.tar.gz: d305f17fa6e613e0ab963f32103e333386977af6f1382379de9011fc4b527b5d9c518d50e104fad5951d0fff9d99e756872927d71ccb92e79b4839fe4482d7d2
data/HISTORY.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 2.1.4 (2014-04-26)
2
+
3
+ * Slightly more robust Time regex in TimeValidator
4
+
1
5
  # 2.1.3 (2014-04-26)
2
6
 
3
7
  * Fixed TimeValidator to use Regex (rather than Time.parse, which isn't available in 2.0,0)
@@ -8,5 +8,5 @@ module CLIUtils
8
8
  SUMMARY = 'Sugary goodness for Ruby CLI apps.'
9
9
 
10
10
  # The current version of the gem
11
- VERSION = '2.1.3'
11
+ VERSION = '2.1.4'
12
12
  end
@@ -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
- @is_valid = text.to_s =~ /^([01]?[0-9]|2[0-3])\:[0-5][0-9](\s?[AaPp][Mm])?$/
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cliutils
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.3
4
+ version: 2.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Bach