torid 1.2.1 → 1.2.2
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/torid.rb +1 -1
- data/lib/torid/uuid.rb +1 -1
- data/test/test_uuid.rb +10 -0
- 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: a8a44c5913356e5021f9a2a436081489c3a9ee1b
|
4
|
+
data.tar.gz: 074d86c36eb1695169ad63410903339b4426f3e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8803f5192ca3e835003345adac45a0db8af7880b195bd75ce2b6791e561135782d210537756d99191c57e9da0edc4e598f733cbc6a4c723486159d929915010
|
7
|
+
data.tar.gz: 2d8b870db402432e01d2dd312f9fbdc3c77c698fee9b04dd34c948e08674eebf51a9efc18d4b7808f77b355a136e9d0544c213cb647c2a7a8e7a4d067802f904
|
data/HISTORY.md
CHANGED
data/lib/torid.rb
CHANGED
data/lib/torid/uuid.rb
CHANGED
@@ -22,7 +22,7 @@ module Torid
|
|
22
22
|
class UUID
|
23
23
|
|
24
24
|
# Regular expression that matches the 36 byte 8-4-4-4-12 format
|
25
|
-
REGEX = %r{[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}}i
|
25
|
+
REGEX = %r{(?<uuid>[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})}i
|
26
26
|
|
27
27
|
# Public: Return if the given string matches the UUID regular expression
|
28
28
|
#
|
data/test/test_uuid.rb
CHANGED
@@ -20,6 +20,16 @@ module Torid
|
|
20
20
|
assert( Torid::UUID::REGEX.match( @guid ) )
|
21
21
|
end
|
22
22
|
|
23
|
+
def test_uuid_captures
|
24
|
+
md = Torid::UUID::REGEX.match( @guid )
|
25
|
+
assert_equal( @guid, md.captures.first )
|
26
|
+
end
|
27
|
+
|
28
|
+
def test_uuid_named_captures
|
29
|
+
md = Torid::UUID::REGEX.match( @guid )
|
30
|
+
assert_equal(@guid, md[:uuid])
|
31
|
+
end
|
32
|
+
|
23
33
|
def test_uuid_no_match
|
24
34
|
assert_equal( nil, Torid::UUID::REGEX.match( "foo" ))
|
25
35
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: torid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Hinegardner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fnv
|