rdf 3.2.5 → 3.2.6

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
  SHA256:
3
- metadata.gz: acd1a596fac04633e2c78342c0d8ec7b6e8b6763160627987df59f9011863ac3
4
- data.tar.gz: cd0b61a753cafe097b3c77de95dc457968661545db2a27482cd68d19facfd068
3
+ metadata.gz: 58dcc9836c4302cad4bb46a86596235794a664d508cc002ce298b6c964265ba9
4
+ data.tar.gz: 941a3daf3a379acf33fe09688ea9cabefd25eb88dc80a7b31d05ac380b2cb2f9
5
5
  SHA512:
6
- metadata.gz: 7a1f7d6d0fd7ee8b70c6ccdcf31468b856008f2f3c7d19203ef8b3fd0a5bf86db6a63b876492b78ce521675d88563f59ce58cda96e5f6ca38b547d14d5ca7e7a
7
- data.tar.gz: 6b3fe1371aca25a13f44aabdfc94bc9d9914c076ad760056dc57f0b89bf3bfa06aaad5c53cf2ea0ea5f0da164e23e7033f73c2d0e503674e7b7f818c16cac1a0
6
+ metadata.gz: f384a93b62b93d574c3dae02e8285f77a3ea6fa26c60eb30aa387e7213343e763a00d9a58f33d0caf4acc5f68a4b27e55361beb792127486059e8afeb333053e
7
+ data.tar.gz: ed8a19309a2b2f042a3f10df60465b56bd5ea9ace1a305cbe595bab507a7606eae99438fe3ce1edbcd653f513bd015aaf19d5e7203c5903278e275dc591e9d15
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.2.5
1
+ 3.2.6
@@ -128,7 +128,7 @@ module RDF; class Literal
128
128
  #
129
129
  # @return [String]
130
130
  def to_s
131
- @string || (@object.strftime(self.class.const_get(:FORMAT)).sub('.000', '') + self.tz)
131
+ @string ||= (@object.strftime(self.class.const_get(:FORMAT)).sub('.000', '') + self.tz)
132
132
  end
133
133
 
134
134
  ##
@@ -146,18 +146,18 @@ module RDF; class Literal
146
146
  #
147
147
  # Otherwise, the timezone is set based on the difference between the current timezone offset (if any) and `zone`.
148
148
  #
149
- # @param [String] zone (nil) In the form of {ZONE_GRAMMAR}.
149
+ # @param [DayTimeDuration, String] zone (nil) In the form of {ZONE_GRAMMAR}.
150
150
  # @return [Temporal] `self`
151
151
  # @raise [RangeError] if `zone < -14*60` or `zone > 14*60`
152
152
  # @see https://www.w3.org/TR/xpath-functions/#func-adjust-dateTime-to-timezone
153
153
  def adjust_to_timezone!(*args)
154
154
  zone = args.empty? ? '+00:00' : args.first
155
- if zone.nil?
155
+ if zone.to_s.empty?
156
156
  # Remove timezone component
157
157
  @object = self.class.new(@object.strftime(self.class.const_get(:FORMAT))).object
158
158
  @zone = nil
159
159
  else
160
- md = zone.match(ZONE_GRAMMAR)
160
+ md = zone.to_s.match(ZONE_GRAMMAR)
161
161
  raise ArgumentError,
162
162
  "expected #{zone.inspect} to be a xsd:dayTimeDuration or +/-HH:MM" unless md
163
163
 
@@ -39,7 +39,10 @@ module RDF; class Literal
39
39
  end
40
40
  # Normalize 24:00:00 to 00:00:00
41
41
  hr, mi, se = tm.split(':')
42
- hr = "%.2i" % (hr.to_i % 24) if hr.to_i > 23
42
+ if hr.to_i > 23
43
+ hr = "%.2i" % (hr.to_i % 24)
44
+ @string = nil
45
+ end
43
46
  value = "#{hr}:#{mi}:#{se}"
44
47
  # Normalize to 1972-12-31 dateTime base
45
48
  ::DateTime.parse("1972-12-31T#{hr}:#{mi}:#{se}#{@zone}")
@@ -317,13 +317,12 @@ class RDF::Query
317
317
  def hash
318
318
  @bindings.hash
319
319
  end
320
-
320
+
321
321
  ##
322
322
  # Equivalence of solution
323
323
  def eql?(other)
324
324
  other.is_a?(Solution) && @bindings.eql?(other.bindings)
325
325
  end
326
- alias_method :==, :eql?
327
326
 
328
327
  ##
329
328
  # Equals of solution
@@ -77,6 +77,15 @@ module RDF; class Query
77
77
  end
78
78
  end
79
79
 
80
+ ##
81
+ # Sets variable names used in these solutions. If not set, the default is determined by the variables used in each solution.
82
+ #
83
+ # @param [Array<Symbol, RDF::Query::Variable>] vars
84
+ # @return [Array<Symbol>]
85
+ def variable_names=(vars)
86
+ @variable_names = vars.map(&:to_sym)
87
+ end
88
+
80
89
  ##
81
90
  # @overload variable?
82
91
  # Returns `false`.
@@ -294,5 +303,17 @@ module RDF; class Query
294
303
  self
295
304
  end
296
305
  alias_method :limit!, :limit
306
+
307
+ ##
308
+ # Equivalence of solution
309
+ def eql?(other)
310
+ super && (!other.respond_to?(:variable_names) || variable_names.eql?(other.variable_names))
311
+ end
312
+
313
+ ##
314
+ # Equals of solution
315
+ def ==(other)
316
+ super && (!other.respond_to?(:variable_names) || variable_names.eql?(other.variable_names))
317
+ end
297
318
  end # Solutions
298
319
  end; end # RDF::Query
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdf
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.5
4
+ version: 3.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arto Bendiken
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2022-02-22 00:00:00.000000000 Z
13
+ date: 2022-03-14 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: link_header