eye-patch 0.1.3 → 0.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: 8a520a2c667c8160b1595d6b9de14e968a613128
4
- data.tar.gz: 6c632e53bb904aad445d0d436571df6f0baa1c13
3
+ metadata.gz: a4fd5387a724ebe2a8206f632a0bd82ebbcbdbb2
4
+ data.tar.gz: 136ce649ba422aa607a6a72b44d3d856a6ba87e8
5
5
  SHA512:
6
- metadata.gz: 748011781a3cb12fb77a819606da590771803a784d5733a3a7936b7772f96d9b0eb4d52bfb3056d0dbdd7c7acc3b8b300077942539074d0cd8a341a4164172bb
7
- data.tar.gz: 568a658b75578aef796bad87ab505bc2402917a51997a519333a52e932e5dce0505457e03c399f616f44963e5beaaca5f9a9c91d8eb01a3ce3b3a3cd9d10a3ab
6
+ metadata.gz: 97f7c12413d6d8099385be3252a121a704499e651b1ea4238b08a49fa90029d625d8afff803cbe1469292ca1ed2905fd7fd96ee6105ed958fa20d01963f09ed2
7
+ data.tar.gz: bfd5dd4a330ab8053c07583ddbd6346e3e78dea17482fdae0cdd80304b7ba15f53640d17721c8546cbfef38e2014956186ae74b5ade09611787c96dfb10c877b
@@ -4,8 +4,8 @@ module Eye::Patch
4
4
 
5
5
  class ValueParser
6
6
 
7
- TIME_MATCHER = / (?<duration>(week|day|hour|minute|second)s?)( |\Z)/.freeze
8
- SIZE_MATCHER = / (?<size>(tera|giga|mega|kilo)?bytes?)( |\Z)/.freeze
7
+ TIME_MATCHER = /\s(?<duration>(?:week|day|hour|minute|second)s?)(?:\s|\Z)/.freeze
8
+ SIZE_MATCHER = /\s(?<size>(?:tera|giga|mega|kilo)?bytes?)(?:\s|\Z)/.freeze
9
9
  MATCHERS = {
10
10
  time: TIME_MATCHER,
11
11
  size: SIZE_MATCHER }.freeze
@@ -1,5 +1,5 @@
1
1
  module Eye
2
2
  module Patch
3
- VERSION = "0.1.3"
3
+ VERSION = "0.1.4"
4
4
  end
5
5
  end
@@ -13,9 +13,10 @@ describe Eye::Patch::ValueParser do
13
13
  assert_equal 3.2.gigabytes, Eye::Patch::ValueParser.parse("3.2 gigabytes")
14
14
  assert_equal 2.4.megabytes, Eye::Patch::ValueParser.parse("2.4 megabytes")
15
15
  assert_equal 1.kilobyte, Eye::Patch::ValueParser.parse("1 kilobyte")
16
+ assert_equal 1.terabyte, Eye::Patch::ValueParser.parse("1 terabyte ")
16
17
  end
17
18
 
18
- it "uses strict word boundary characters" do
19
+ it "uses whitespace as word boundary characters" do
19
20
  assert_equal "second-thing", Eye::Patch::ValueParser.parse("second-thing")
20
21
  assert_equal "minutes", Eye::Patch::ValueParser.parse("minutes")
21
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eye-patch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Horner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-19 00:00:00.000000000 Z
11
+ date: 2014-02-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: eye