rdf-xsd 0.3.3 → 0.3.4
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/README.markdown +8 -0
- data/VERSION +1 -1
- data/lib/rdf/xsd/binary.rb +7 -1
- data/lib/rdf/xsd/date.rb +1 -0
- data/lib/rdf/xsd/integer.rb +3 -2
- metadata +14 -14
data/README.markdown
CHANGED
@@ -25,7 +25,10 @@ Examples
|
|
25
25
|
Full documentation available on [Rubydoc.info][XSD doc]
|
26
26
|
|
27
27
|
### Principle Classes
|
28
|
+
* {RDF::Literal::Base64Binary}
|
29
|
+
* {RDF::Literal::Duration}
|
28
30
|
* {RDF::Literal::Float}
|
31
|
+
* {RDF::Literal::HexBinary}
|
29
32
|
* {RDF::Literal::NonPositiveInteger}
|
30
33
|
* {RDF::Literal::NegativeInteger}
|
31
34
|
* {RDF::Literal::Long}
|
@@ -38,6 +41,11 @@ Full documentation available on [Rubydoc.info][XSD doc]
|
|
38
41
|
* {RDF::Literal::UnsignedInt}
|
39
42
|
* {RDF::Literal::UnsignedShort}
|
40
43
|
* {RDF::Literal::UnsignedByte}
|
44
|
+
* {RDF::Literal::YearMonth}
|
45
|
+
* {RDF::Literal::Year}
|
46
|
+
* {RDF::Literal::MonthDay}
|
47
|
+
* {RDF::Literal::Month}
|
48
|
+
* {RDF::Literal::Day}
|
41
49
|
|
42
50
|
## Dependencies
|
43
51
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.4
|
data/lib/rdf/xsd/binary.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# coding: utf-8
|
1
2
|
require 'base64'
|
2
3
|
|
3
4
|
module RDF; class Literal
|
@@ -59,9 +60,14 @@ module RDF; class Literal
|
|
59
60
|
# Returns `true` if the value adheres to the defined grammar of the
|
60
61
|
# datatype.
|
61
62
|
#
|
63
|
+
# Note: depends on implementation of Base64.strict_decode64, which may not
|
64
|
+
# be implemented for Ruby 1.8.x.
|
65
|
+
#
|
62
66
|
# @return [Boolean]
|
63
67
|
def valid?
|
64
|
-
Base64.strict_decode64
|
68
|
+
Base64.respond_to?(:strict_decode64) ?
|
69
|
+
Base64.strict_decode64(value.gsub(/\s+/m, '')) :
|
70
|
+
Base64.decode64(value.gsub(/\s+/m, ''))
|
65
71
|
true
|
66
72
|
rescue ArgumentError
|
67
73
|
STDERR.puts($!.inspect + ": #{value.inspect}")
|
data/lib/rdf/xsd/date.rb
CHANGED
data/lib/rdf/xsd/integer.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# coding: utf-8
|
1
2
|
module RDF; class Literal
|
2
3
|
##
|
3
4
|
# nonPositiveInteger is derived from integer by setting the value of maxInclusive to be 0. This results in
|
@@ -109,7 +110,7 @@ module RDF; class Literal
|
|
109
110
|
##
|
110
111
|
# nonNegativeInteger is derived from integer by setting the value of minInclusive to be 0. This results in
|
111
112
|
# the standard mathematical concept of the non-negative integers. The value space of nonNegativeInteger is the
|
112
|
-
# infinite set
|
113
|
+
# infinite set [0,1,2,...]. The base type of nonNegativeInteger is integer.
|
113
114
|
#
|
114
115
|
# @see http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/#nonNegativeInteger
|
115
116
|
class NonNegativeInteger < Integer
|
@@ -124,7 +125,7 @@ module RDF; class Literal
|
|
124
125
|
##
|
125
126
|
# positiveInteger is derived from nonNegativeInteger by setting the value of minInclusive to be 1. This
|
126
127
|
# results in the standard mathematical concept of the positive integer numbers. The value space of
|
127
|
-
# positiveInteger is the infinite set
|
128
|
+
# positiveInteger is the infinite set [1,2,...]. The base type of positiveInteger is nonNegativeInteger.
|
128
129
|
#
|
129
130
|
# @see http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/#positiveInteger
|
130
131
|
class PositiveInteger < NonNegativeInteger
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rdf-xsd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,22 +10,22 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2011-09-15 00:00:00.
|
13
|
+
date: 2011-09-15 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rdf
|
17
|
-
requirement: &
|
17
|
+
requirement: &2160138240 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ! '>='
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 0.3.
|
22
|
+
version: 0.3.4
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *2160138240
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: rspec
|
28
|
-
requirement: &
|
28
|
+
requirement: &2160117520 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ! '>='
|
@@ -33,10 +33,10 @@ dependencies:
|
|
33
33
|
version: 2.5.0
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *2160117520
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: rdf-spec
|
39
|
-
requirement: &
|
39
|
+
requirement: &2160116640 !ruby/object:Gem::Requirement
|
40
40
|
none: false
|
41
41
|
requirements:
|
42
42
|
- - ! '>='
|
@@ -44,10 +44,10 @@ dependencies:
|
|
44
44
|
version: 0.3.2
|
45
45
|
type: :development
|
46
46
|
prerelease: false
|
47
|
-
version_requirements: *
|
47
|
+
version_requirements: *2160116640
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: yard
|
50
|
-
requirement: &
|
50
|
+
requirement: &2160115500 !ruby/object:Gem::Requirement
|
51
51
|
none: false
|
52
52
|
requirements:
|
53
53
|
- - ! '>='
|
@@ -55,8 +55,8 @@ dependencies:
|
|
55
55
|
version: 0.6.0
|
56
56
|
type: :development
|
57
57
|
prerelease: false
|
58
|
-
version_requirements: *
|
59
|
-
description: Adds RDF::Literal subclasses for extended XSD datatypes
|
58
|
+
version_requirements: *2160115500
|
59
|
+
description: Adds RDF::Literal subclasses for extended XSD datatypes.
|
60
60
|
email: public-rdf-ruby@w3.org
|
61
61
|
executables: []
|
62
62
|
extensions: []
|
@@ -94,8 +94,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
94
94
|
version: '0'
|
95
95
|
requirements: []
|
96
96
|
rubyforge_project: rdf-xsd
|
97
|
-
rubygems_version: 1.8.
|
97
|
+
rubygems_version: 1.8.10
|
98
98
|
signing_key:
|
99
99
|
specification_version: 3
|
100
|
-
summary: Extended XSD Datatypes for RDF.rb
|
100
|
+
summary: Extended XSD Datatypes for RDF.rb.
|
101
101
|
test_files: []
|