rdf-xsd 2.0.0 → 2.1.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3c8091ec459695b3f7d65b7c9afa0ee1a153cdae
4
- data.tar.gz: 381c04090c4c25915126f4991b1caa2c246b24c0
3
+ metadata.gz: 299d53cf4cff465610e37bae3656161caee2d5ad
4
+ data.tar.gz: a9eacde4fa7dbc369e363019b529afb759b2c655
5
5
  SHA512:
6
- metadata.gz: 8026f3ed1debca4bd5fe3b30ce885ed2b897d4e536328b1dc1080562ef670fd4bfde52b2a7e51b2a657d35245b89bcdce9d16403ccb0a7323945eba7e94933a4
7
- data.tar.gz: b19008361279b9b5bd3e03e7dedabd0f23f0f9aef6aac7da7236e577dae3a8599406d282668510682853f6b940b361c215208be86c31027aec2bdbe114a669db
6
+ metadata.gz: 21af75c157c51aa6877737b96e1cfa12cf73effbb53176598832e178a0d4cebe3d772f9fd8f2d739b72addd84f643b797d135a25f5dda2ae32ebd9cfbb88e45a
7
+ data.tar.gz: 4352263c4d32d275203722cb853366c725f57adbf77c12f3fba6b1d0e7b60fb217369f7e3c89965a9373a2c9e4cd84c59fb5e6cd84c7fb0c34d63c278af71dbc
data/README.md CHANGED
@@ -22,7 +22,7 @@ This gem adds additional RDF::Literal subclasses for extended [XSD datatypes][]
22
22
  require 'rdf/xsd'
23
23
 
24
24
  ## Dependencies
25
- * [Ruby](http://ruby-lang.org/) (>= 2.0.0)
25
+ * [Ruby](http://ruby-lang.org/) (>= 2.2.2)
26
26
  * [RDF.rb](http://rubygems.org/gems/rdf) (>= 2.0)
27
27
  * Soft dependency on [Nokogiri](http://rubygems.org/gems/nokogiri) (>= 1.6)
28
28
  * Soft dependency on [EquivalentXML](http://rubygems.org/gems/equivalent-xml) (>= 0.2.8)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.0
1
+ 2.1.0
@@ -24,9 +24,9 @@ module RDF; class Literal
24
24
  # @param [String, Object] value
25
25
  # If given a string, it will decode it as an object value.
26
26
  # Otherwise, it will take the value as the object and encode to retrieve a value
27
- # @option options [String] :lexical (nil)
28
- def initialize(value, options = {})
29
- super
27
+ # @param [String] lexical (nil)
28
+ def initialize(value, datatype: nil, lexical: nil, **options)
29
+ super(value, datatype: datatype, lexical: lexical)
30
30
  @object = RDF::URI(value)
31
31
  canonicalize! unless value.is_a?(String)
32
32
  end
@@ -19,8 +19,8 @@ module RDF; class Literal
19
19
  ##
20
20
  # @param [String] value The encoded form of the literal
21
21
  # @option options [String] :object (nil) decoded value
22
- def initialize(value, options = {})
23
- super
22
+ def initialize(value, datatype: nil, lexical: nil, **options)
23
+ super(value, datatype: datatype, lexical: lexical)
24
24
  @object = options.fetch(:object, hex_to_bin(value.to_s))
25
25
  @string ||= bin_to_hex(@object)
26
26
  end
@@ -66,8 +66,8 @@ module RDF; class Literal
66
66
  # If given a string, it will decode it as an object value.
67
67
  # Otherwise, it will take the value as the object and encode to retrieve a value
68
68
  # @option options [String] :lexical (nil)
69
- def initialize(value, options = {})
70
- super
69
+ def initialize(value, datatype: nil, lexical: nil, **options)
70
+ super(value, datatype: datatype, lexical: lexical)
71
71
  @object = value.is_a?(String) ? ::Base64.decode64(value) : value
72
72
  canonicalize! unless value.is_a?(String)
73
73
  end
data/lib/rdf/xsd/date.rb CHANGED
@@ -26,10 +26,10 @@ module RDF; class Literal
26
26
  GRAMMAR = %r(\A(-?\d{4,}-\d{2})((?:[\+\-]\d{2}:\d{2})|UTC|Z)?\Z).freeze
27
27
  FORMAT = '%Y-%m%Z'.freeze
28
28
 
29
- def initialize(value, options = {})
30
- @string = options.fetch(:lexical, value.to_s)
29
+ def initialize(value, datatype: nil, lexical: nil, **options)
30
+ @string = lexical || value.to_s
31
31
  object = GRAMMAR.match(value.to_s) && ::Date.parse("#{$1}-01#{$2}")
32
- super(object, options)
32
+ super(object, lexical: @string)
33
33
  end
34
34
  end
35
35
 
@@ -44,10 +44,10 @@ module RDF; class Literal
44
44
  GRAMMAR = %r(\A(-?\d{4,})((?:[\+\-]\d{2}:\d{2})|UTC|Z)?\Z).freeze
45
45
  FORMAT = '%Y%Z'.freeze
46
46
 
47
- def initialize(value, options = {})
48
- @string = options.fetch(:lexical, value.to_s)
47
+ def initialize(value, datatype: nil, lexical: nil, **options)
48
+ @string = lexical || value.to_s
49
49
  object = GRAMMAR.match(value.to_s) && ::Date.parse("#{$1}-01-01#{$2}")
50
- super(object, options)
50
+ super(object, lexical: @string)
51
51
  end
52
52
  end
53
53
 
@@ -62,10 +62,10 @@ module RDF; class Literal
62
62
  GRAMMAR = %r(\A--(\d{2}-\d{2})((?:[\+\-]\d{2}:\d{2})|UTC|Z)?\Z).freeze
63
63
  FORMAT = '%m-%d%Z'.freeze
64
64
 
65
- def initialize(value, options = {})
66
- @string = options.fetch(:lexical, value.to_s)
65
+ def initialize(value, datatype: nil, lexical: nil, **options)
66
+ @string = lexical || value.to_s
67
67
  object = GRAMMAR.match(value.to_s) && ::Date.parse("0000-#{$1}#{$2}")
68
- super(object, options)
68
+ super(object, lexical: @string)
69
69
  end
70
70
  end
71
71
 
@@ -80,10 +80,10 @@ module RDF; class Literal
80
80
  GRAMMAR = %r(\A---(\d{2})((?:[\+\-]\d{2}:\d{2})|UTC|Z)?\Z).freeze
81
81
  FORMAT = '%d%Z'.freeze
82
82
 
83
- def initialize(value, options = {})
84
- @string = options.fetch(:lexical, value.to_s)
83
+ def initialize(value, datatype: nil, lexical: nil, **options)
84
+ @string = lexical || value.to_s
85
85
  object = GRAMMAR.match(value.to_s) && ::Date.parse("0000-01-#{$1}#{$2}")
86
- super(object, options)
86
+ super(object, lexical: @string)
87
87
  end
88
88
  end
89
89
 
@@ -97,10 +97,10 @@ module RDF; class Literal
97
97
  GRAMMAR = %r(\A--(\d{2})((?:[\+\-]\d{2}:\d{2})|UTC|Z)?\Z).freeze
98
98
  FORMAT = '%m%Z'.freeze
99
99
 
100
- def initialize(value, options = {})
101
- @string = options.fetch(:lexical, value.to_s)
100
+ def initialize(value, datatype: nil, lexical: nil, **options)
101
+ @string = lexical || value.to_s
102
102
  object = GRAMMAR.match(value.to_s) && ::Date.parse("0000-#{$1}-01#{$2}")
103
- super(object, options)
103
+ super(object, lexical: @string)
104
104
  end
105
105
  end
106
106
  end; end #RDF::Literal
@@ -33,7 +33,7 @@ module RDF; class Literal
33
33
  # * Hash form is used for internal representation
34
34
  # @param [Duration, Hash, Numeric, #to_s] value
35
35
  # @option options [String] :lexical (nil)
36
- def initialize(value, options = {})
36
+ def initialize(value, datatype: nil, lexical: nil, **options)
37
37
  super
38
38
  @object = case value
39
39
  when Hash
data/lib/rdf/xsd/xml.rb CHANGED
@@ -33,12 +33,12 @@ module RDF; class Literal
33
33
 
34
34
  ##
35
35
  # @param [Object] value
36
- # @option options [String] :lexical (nil)
36
+ # @param [String] lexical (nil)
37
37
  # @option options [:nokogiri, :rexml] :library
38
38
  # Library to use, defaults to :nokogiri if available, :rexml otherwise
39
- def initialize(value, options = {})
40
- @datatype = options[:datatype] || DATATYPE
41
- @string = options[:lexical] if options.has_key?(:lexical)
39
+ def initialize(value, datatype: nil, lexical: nil, **options)
40
+ @datatype = datatype || DATATYPE
41
+ @string = lexical if lexical
42
42
  if value.is_a?(String)
43
43
  @string ||= value
44
44
  else
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: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregg
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-04-10 00:00:00.000000000 Z
12
+ date: 2016-12-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rdf
@@ -17,28 +17,28 @@ dependencies:
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: '2.0'
20
+ version: '2.1'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: '2.0'
27
+ version: '2.1'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: activesupport
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: '4.1'
34
+ version: '5.0'
35
35
  type: :development
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: '4.1'
41
+ version: '5.0'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: i18n
44
44
  requirement: !ruby/object:Gem::Requirement
@@ -144,7 +144,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
144
144
  requirements:
145
145
  - - ">="
146
146
  - !ruby/object:Gem::Version
147
- version: '2.0'
147
+ version: 2.2.2
148
148
  required_rubygems_version: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - ">="
@@ -152,9 +152,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
152
152
  version: '0'
153
153
  requirements: []
154
154
  rubyforge_project: rdf-xsd
155
- rubygems_version: 2.4.8
155
+ rubygems_version: 2.6.8
156
156
  signing_key:
157
157
  specification_version: 4
158
158
  summary: Extended XSD Datatypes for RDF.rb.
159
159
  test_files: []
160
- has_rdoc: false