xml_schema 0.1.0 → 0.1.1
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.
- data/ChangeLog +5 -0
- data/Gemfile.lock +1 -1
- data/lib/xml_schema/ns.rb +14 -12
- data/lib/xml_schema/version.rb +1 -1
- metadata +2 -2
data/ChangeLog
CHANGED
data/Gemfile.lock
CHANGED
data/lib/xml_schema/ns.rb
CHANGED
@@ -1,23 +1,19 @@
|
|
1
1
|
require 'uri'
|
2
2
|
|
3
3
|
module NS
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
'RDFS' => 'http://www.w3.org/2000/01/rdf-schema'
|
10
|
-
}
|
11
|
-
|
12
|
-
ALL.each do |name, url|
|
4
|
+
# Add a resource namespace
|
5
|
+
#
|
6
|
+
# @param [String] name name of the module
|
7
|
+
# @param [String] uri URI of the resource
|
8
|
+
def self.add(name, uri)
|
13
9
|
ns_module = self.const_set(name, Module.new)
|
14
10
|
ns_module.module_eval <<-HERE
|
15
11
|
def self.uri
|
16
|
-
URI(\"#{
|
12
|
+
URI(\"#{uri.sub(/\/?$/, '/')}\")
|
17
13
|
end
|
18
14
|
|
19
15
|
def self.to_s
|
20
|
-
\"#{
|
16
|
+
\"#{uri}\"
|
21
17
|
end
|
22
18
|
|
23
19
|
def self.[](value)
|
@@ -25,5 +21,11 @@ module NS
|
|
25
21
|
end
|
26
22
|
HERE
|
27
23
|
end
|
28
|
-
|
29
24
|
end
|
25
|
+
|
26
|
+
NS.add 'XMLSchema', 'http://www.w3.org/2001/XMLSchema'
|
27
|
+
NS.add 'OWL', 'http://www.w3.org/2002/07/owl'
|
28
|
+
NS.add 'RDF', 'http://www.w3.org/1999/02/22-rdf-syntax-ns'
|
29
|
+
NS.add 'RDFS', 'http://www.w3.org/2000/01/rdf-schema'
|
30
|
+
NS.add 'FOAF', 'http://xmlns.com/foaf/0.1'
|
31
|
+
NS.add 'DC', 'http://purl.org/dc'
|
data/lib/xml_schema/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xml_schema
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-07-
|
12
|
+
date: 2012-07-29 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Helper methods and constants to handle XmlSchema
|
15
15
|
email:
|