eye-patch 0.1.3 → 0.1.4
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/eye/patch/value_parser.rb +2 -2
- data/lib/eye/patch/version.rb +1 -1
- data/test/lib/eye/patch/value_parser_test.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a4fd5387a724ebe2a8206f632a0bd82ebbcbdbb2
|
|
4
|
+
data.tar.gz: 136ce649ba422aa607a6a72b44d3d856a6ba87e8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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 =
|
|
8
|
-
SIZE_MATCHER =
|
|
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
|
data/lib/eye/patch/version.rb
CHANGED
|
@@ -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
|
|
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.
|
|
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-
|
|
11
|
+
date: 2014-02-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: eye
|