uri-urn 0.0.2 → 0.0.3

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: ceac9f15a424139fa6e8e2d6e3822c7dfe3c0b04
4
- data.tar.gz: 1cfd4a1a3207aadd3aa1e9526c746c04e1605965
3
+ metadata.gz: 09cb3b02bfce7ed5b5f1d658328f11a643278053
4
+ data.tar.gz: 182d2b82425c850823030e05338372ff09c053b3
5
5
  SHA512:
6
- metadata.gz: ce5dc4edaed6a38533cea3ccf91463e79ea0408a14938135dadc998e0a1ca6351458e05e87557e3dce7101807a524eeb52bb1dc238dcf18d0b94211df581ac99
7
- data.tar.gz: 4c769a7b98f4c07f8b982dd84a075be6e8666a7291ff74caa0ae231c6ea52976cfd6a09954521b8a80ec87fb3fd245bbec237fe1af9fd70aaad76e20196ced4d
6
+ metadata.gz: 64d8e0a6bd7f019cd39be1d163376af35017de5001eb4417e5dc364df6420134972d189d5e04df17f7d10d95f9e6cf762f12c6b84b79d462a94d00add9f660b3
7
+ data.tar.gz: 6c077d38a8d7c9b19b1383ab452525bc115e6046abc33497a22ba23ef77f1569e144d2536711fe4b40aedf10848e4c1aacc7e9ce2ba8b9dba78f89ef3b5d3095
@@ -1,7 +1,7 @@
1
1
  URI::URN
2
2
  ========
3
3
 
4
- This library adds URN scheme support for standard bundled URI library described in [RFC 4122][rfc4122].
4
+ This library adds URN scheme support for standard bundled URI library described in [RFC 2141][rfc2141].
5
5
 
6
6
  Installation
7
7
  ------------
@@ -29,6 +29,13 @@ For known Namespace IDs such as UUID, URI parses and returns URNs of them.
29
29
  urn.nid # => "uuid"
30
30
  urn.nss # => "01787092-e668-4234-bde9-15444f9c5560"
31
31
 
32
+ isbn = URI.parse('urn:isbn:978-4274064616')
33
+ isbn.class # => URI::URN::ISBN
34
+ isbn.scheme # => "urn"
35
+ isbn.nid #=> "isbn"
36
+ isbn.nss #=> "978-4274064616"
37
+ isbn.normalize! # => "9784274064616"
38
+
32
39
  For unknown Namespace URN, returns URI::URN::Generic object.
33
40
 
34
41
  URI.parse('urn:dummy:specific-string') # => #<URI::URN::Generic:0x007f3028cc3c10 URL:urn:dummy:specific-string>
@@ -37,7 +44,7 @@ For unknown Namespace URN, returns URI::URN::Generic object.
37
44
 
38
45
  Currently supported:
39
46
 
40
- * UUID
47
+ * UUID([RFC 4122][rfc4122])
41
48
  * ISBN
42
49
 
43
50
  ### Adding Namespaces
@@ -65,4 +72,5 @@ Contributing
65
72
  4. Push to the branch (`git push origin my-new-feature`)
66
73
  5. Create a new Merge Request
67
74
 
75
+ [rfc2141]: http://www.ietf.org/rfc/rfc2141.txt
68
76
  [rfc4122]: http://www.ietf.org/rfc/rfc4122.txt
@@ -9,7 +9,7 @@ module URI
9
9
  end
10
10
 
11
11
  def self.new(*arg)
12
- nid = (md = arg[6].match(Generic::URN_REGEXP)) && md['nid']
12
+ nid = (md = arg[6].to_s.match(Generic::URN_REGEXP)) && md['nid']
13
13
  @@nids[nid.to_s.upcase].new(*arg)
14
14
  end
15
15
 
@@ -121,3 +121,4 @@ module URI
121
121
  end
122
122
 
123
123
  require 'uri/urn/uuid'
124
+ require 'uri/urn/isbn'
@@ -16,4 +16,3 @@ module URI
16
16
  @@nids['ISBN'] = ISBN
17
17
  end
18
18
  end
19
-
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "uri-urn"
3
- spec.version = '0.0.2'
3
+ spec.version = '0.0.3'
4
4
  spec.authors = ["KITAITI Makoto"]
5
5
  spec.email = ["KitaitiMakoto@gmail.com"]
6
6
  spec.summary = %q{Adds URN Scheme support to URI lib.}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uri-urn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - KITAITI Makoto
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-12 00:00:00.000000000 Z
11
+ date: 2016-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubygems-tasks
@@ -68,7 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
68
68
  version: '0'
69
69
  requirements: []
70
70
  rubyforge_project:
71
- rubygems_version: 2.2.2
71
+ rubygems_version: 2.5.1
72
72
  signing_key:
73
73
  specification_version: 4
74
74
  summary: Adds URN Scheme support to URI lib.