uri-urn 0.0.2 → 0.0.3
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/README.markdown +10 -2
- data/lib/uri/urn.rb +2 -1
- data/lib/uri/urn/isbn.rb +0 -1
- data/uri-urn.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 09cb3b02bfce7ed5b5f1d658328f11a643278053
|
4
|
+
data.tar.gz: 182d2b82425c850823030e05338372ff09c053b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64d8e0a6bd7f019cd39be1d163376af35017de5001eb4417e5dc364df6420134972d189d5e04df17f7d10d95f9e6cf762f12c6b84b79d462a94d00add9f660b3
|
7
|
+
data.tar.gz: 6c077d38a8d7c9b19b1383ab452525bc115e6046abc33497a22ba23ef77f1569e144d2536711fe4b40aedf10848e4c1aacc7e9ce2ba8b9dba78f89ef3b5d3095
|
data/README.markdown
CHANGED
@@ -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
|
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
|
data/lib/uri/urn.rb
CHANGED
@@ -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'
|
data/lib/uri/urn/isbn.rb
CHANGED
data/uri-urn.gemspec
CHANGED
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.
|
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:
|
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.
|
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.
|