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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 904f97e3e10a368d48b9ed1b56f3432b6ee7cf0a
4
- data.tar.gz: 99f03c856b0d00bcbcaf0d795b9f41f851f4649b
3
+ metadata.gz: a8a44c5913356e5021f9a2a436081489c3a9ee1b
4
+ data.tar.gz: 074d86c36eb1695169ad63410903339b4426f3e0
5
5
  SHA512:
6
- metadata.gz: 39f9398d44e8e80199117a3c119ada2186c151f5ee2f3373146178c600206c6d4a787527e581551d33181384595ce8e0bc31e2d6998250031be87dd72fc036b9
7
- data.tar.gz: 208f6443b30679a1b54c6b26818c8b2c903f699195a7e8db3dec89d38c36cb54f805bdf2a9fe5aa94d4cb662edc1f773cbcc09239de13b6048043a62257a7a59
6
+ metadata.gz: d8803f5192ca3e835003345adac45a0db8af7880b195bd75ce2b6791e561135782d210537756d99191c57e9da0edc4e598f733cbc6a4c723486159d929915010
7
+ data.tar.gz: 2d8b870db402432e01d2dd312f9fbdc3c77c698fee9b04dd34c948e08674eebf51a9efc18d4b7808f77b355a136e9d0544c213cb647c2a7a8e7a4d067802f904
data/HISTORY.md CHANGED
@@ -1,4 +1,8 @@
1
1
  # Torid Changelog
2
+ ## Version 1.2.2 - 2014-09-13
3
+
4
+ * And named captures to the uuid regex.
5
+
2
6
  ## Version 1.2.1 - 2014-09-13
3
7
 
4
8
  * Fix bug where after a fork you could generate the same uuids in different
@@ -2,7 +2,7 @@
2
2
  # that sort lexically in time order.
3
3
  module Torid
4
4
  # Public: The Version of the Torid library as a String
5
- VERSION = "1.2.1"
5
+ VERSION = "1.2.2"
6
6
 
7
7
  # Public: return the next Torid::UUID from the default Generator
8
8
  #
@@ -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
  #
@@ -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.1
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-13 00:00:00.000000000 Z
11
+ date: 2014-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fnv