rdf 3.2.9 → 3.2.11

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
  SHA256:
3
- metadata.gz: 73bbb2bcc84c974f9ecfe2b1f9a41cf445273e76cfdbd6fd84b6141790b85092
4
- data.tar.gz: 5a339b4166238e83c491555bc084e9132491da17c54234252b4bc60b5b8451db
3
+ metadata.gz: 0ef89e587b939972de3597dc342a8833f6815f2a00e06369c3384337ff78523b
4
+ data.tar.gz: 91754a8af99feb95e0c2d318d89eefe8593c8ceded4cf89e90765e77d21811b8
5
5
  SHA512:
6
- metadata.gz: d083cfe87a7894a616966a8d0bdc9a4d0b11814fde48a95bf94f83cc0fcc6ffd939b0ddd765079e0ca2514fbc7df182bebea0870d4a7d8f2817bba72cb7c4bab
7
- data.tar.gz: ce59b7a5f8340f9fee88ad374c1452df356312ad3621e64e678054508616b32648e7cb49fc9fd42563cc8c8079d99500d9c779a9dcf1924e0804ca97e17ea69e
6
+ metadata.gz: da439fdf65b894cf527b85f6ac5315e5fc6c2066c9e642cd36ed67bb1c674b766adbb23a345030d2dbb8af4af1054efc416ebcc8731a04ee803eae682fb34229
7
+ data.tar.gz: 9da07ff7cf54522a90a0a396a5f8cad5b6b89d373a2675db89a5287865ee80db1d0359d03c6a10f30313d7eb93f101673ba2ff87cef9695e2df929a04d4e481d
data/README.md CHANGED
@@ -5,7 +5,7 @@ This is a pure-Ruby library for working with [Resource Description Framework
5
5
 
6
6
  * <https://ruby-rdf.github.io/rdf>
7
7
 
8
- [![Gem Version](https://badge.fury.io/rb/rdf.png)](https://badge.fury.io/rb/rdf)
8
+ [![Gem Version](https://badge.fury.io/rb/rdf.svg)](https://badge.fury.io/rb/rdf)
9
9
  [![Build Status](https://github.com/ruby-rdf/rdf/workflows/CI/badge.svg?branch=develop)](https://github.com/ruby-rdf/rdf/actions?query=workflow%3ACI)
10
10
  [![Coverage Status](https://coveralls.io/repos/ruby-rdf/rdf/badge.svg?branch=develop)](https://coveralls.io/github/ruby-rdf/rdf?branch=develop)
11
11
  [![Gitter chat](https://badges.gitter.im/ruby-rdf/rdf.png)](https://gitter.im/ruby-rdf/rdf)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.2.9
1
+ 3.2.11
@@ -41,7 +41,7 @@ module RDF
41
41
  def load(url, graph_name: nil, **options)
42
42
  raise TypeError.new("#{self} is immutable") if immutable?
43
43
 
44
- Reader.open(url, base_uri: url, **options) do |reader|
44
+ Reader.open(url, **options.merge(base_uri: url)) do |reader|
45
45
  if graph_name
46
46
  statements = []
47
47
  reader.each_statement do |statement|
@@ -280,19 +280,6 @@ module RDF
280
280
  end
281
281
  end
282
282
 
283
- ##
284
- # Returns the element at `index`.
285
- #
286
- # @example
287
- # RDF::List[1, 2, 3][0] #=> RDF::Literal(1)
288
- #
289
- # @param [Integer] index
290
- # @return [RDF::Term]
291
- # @see http://ruby-doc.org/core-2.2.2/Array.html#method-i-5B-5D
292
- def [](index)
293
- at(index)
294
- end
295
-
296
283
  ##
297
284
  # Element Assignment — Sets the element at `index`, or replaces a subarray from the `start` index for `length` elements, or replaces a subarray specified by the `range` of indices.
298
285
  #
data/lib/rdf/model/uri.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+ # frozen_string_literal: true
2
3
  require 'cgi'
3
4
 
4
5
  module RDF
@@ -28,27 +29,27 @@ module RDF
28
29
  include RDF::Resource
29
30
 
30
31
  # IRI components
31
- UCSCHAR = Regexp.compile(<<-EOS.gsub(/\s+/, ''))
32
- [\\u00A0-\\uD7FF]|[\\uF900-\\uFDCF]|[\\uFDF0-\\uFFEF]|
33
- [\\u{10000}-\\u{1FFFD}]|[\\u{20000}-\\u{2FFFD}]|[\\u{30000}-\\u{3FFFD}]|
34
- [\\u{40000}-\\u{4FFFD}]|[\\u{50000}-\\u{5FFFD}]|[\\u{60000}-\\u{6FFFD}]|
35
- [\\u{70000}-\\u{7FFFD}]|[\\u{80000}-\\u{8FFFD}]|[\\u{90000}-\\u{9FFFD}]|
36
- [\\u{A0000}-\\u{AFFFD}]|[\\u{B0000}-\\u{BFFFD}]|[\\u{C0000}-\\u{CFFFD}]|
37
- [\\u{D0000}-\\u{DFFFD}]|[\\u{E1000}-\\u{EFFFD}]
38
- EOS
39
- IPRIVATE = Regexp.compile("[\\uE000-\\uF8FF]|[\\u{F0000}-\\u{FFFFD}]|[\\u100000-\\u10FFFD]").freeze
32
+ UCSCHAR = %(
33
+ \\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF
34
+ \\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}
35
+ \\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}
36
+ \\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}
37
+ \\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}
38
+ \\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}
39
+ ).gsub(/\s+/, '')
40
+ IPRIVATE = Regexp.compile("[\\uE000-\\uF8FF\\u{F0000}-\\u{FFFFD}\\u{100000}-\\u{10FFFD}]").freeze
40
41
  SCHEME = Regexp.compile("[A-Za-z](?:[A-Za-z0-9+-\.])*").freeze
41
42
  PORT = Regexp.compile("[0-9]*").freeze
42
43
  IP_literal = Regexp.compile("\\[[0-9A-Fa-f:\\.]*\\]").freeze # Simplified, no IPvFuture
43
44
  PCT_ENCODED = Regexp.compile("%[0-9A-Fa-f][0-9A-Fa-f]").freeze
44
- GEN_DELIMS = Regexp.compile("[:/\\?\\#\\[\\]@]").freeze
45
- SUB_DELIMS = Regexp.compile("[!\\$&'\\(\\)\\*\\+,;=]").freeze
46
- RESERVED = Regexp.compile("(?:#{GEN_DELIMS}|#{SUB_DELIMS})").freeze
45
+ GEN_DELIMS = Regexp.compile(%q{[:/\?\#\[\]@]}).freeze
46
+ SUB_DELIMS = Regexp.compile(%q{[!\$&'\(\)\*\+,;=]}).freeze
47
+ RESERVED = Regexp.union(GEN_DELIMS, SUB_DELIMS).freeze
47
48
  UNRESERVED = Regexp.compile("[A-Za-z0-9\._~-]").freeze
48
49
 
49
- IUNRESERVED = Regexp.compile("[A-Za-z0-9\._~-]|#{UCSCHAR}").freeze
50
+ IUNRESERVED = Regexp.union(UNRESERVED, Regexp.compile("[#{UCSCHAR}]")).freeze
50
51
 
51
- IPCHAR = Regexp.compile("(?:#{IUNRESERVED}|#{PCT_ENCODED}|#{SUB_DELIMS}|:|@)").freeze
52
+ IPCHAR = Regexp.union(IUNRESERVED, PCT_ENCODED, SUB_DELIMS, /[:|@]/).freeze
52
53
 
53
54
  IQUERY = Regexp.compile("(?:#{IPCHAR}|#{IPRIVATE}|/|\\?)*").freeze
54
55
 
@@ -65,7 +66,7 @@ module RDF
65
66
  IPATH_EMPTY = Regexp.compile("").freeze
66
67
 
67
68
  IREG_NAME = Regexp.compile("(?:(?:#{IUNRESERVED})|(?:#{PCT_ENCODED})|(?:#{SUB_DELIMS}))*").freeze
68
- IHOST = Regexp.compile("(?:#{IP_literal})|(?:#{IREG_NAME})").freeze
69
+ IHOST = Regexp.union(IP_literal, IREG_NAME).freeze
69
70
  IUSERINFO = Regexp.compile("(?:(?:#{IUNRESERVED})|(?:#{PCT_ENCODED})|(?:#{SUB_DELIMS})|:)*").freeze
70
71
  IAUTHORITY = Regexp.compile("(?:#{IUSERINFO}@)?#{IHOST}(?::#{PORT})?").freeze
71
72
 
@@ -116,7 +117,21 @@ module RDF
116
117
  # Note: not all reserved characters need to be escaped in SPARQL/Turtle, but they must be unescaped when encountered
117
118
  PN_ESCAPE_CHARS = /[~\.!\$&'\(\)\*\+,;=\/\?\#@%]/.freeze
118
119
  PN_ESCAPES = /\\#{Regexp.union(PN_ESCAPE_CHARS, /[\-_]/)}/.freeze
119
-
120
+
121
+ # For URI encoding
122
+ # iuserinfo = *( iunreserved / pct-encoded / sub-delims / ":" )
123
+ ENCODE_USER =
124
+ ENCODE_PASSWORD = Regexp.compile("[^A-Za-z0-9\._~#{UCSCHAR}!$&'\(\)\*\+,;=:-]").freeze
125
+ # isegment = *ipchar
126
+ # ipchar = iunreserved / pct-encoded / sub-delims / ":" / "@"
127
+ ENCODE_ISEGMENT = Regexp.compile("[^A-Za-z0-9\._~#{UCSCHAR}!$&'\(\)\*\+,;=:-]").freeze
128
+ # isegment-nz-nc = 1*( iunreserved / pct-encoded / sub-delims / "@" )
129
+ ENCODE_ISEGMENT_NC = Regexp.compile("[^A-Za-z0-9\._~#{UCSCHAR}!$&'\(\)\*\+,;=-]").freeze
130
+ # iquery = *( ipchar / iprivate / "/" / "?" )
131
+ ENCODE_IQUERY = Regexp.compile("[^A-Za-z0-9\._~#{UCSCHAR}\\uE000-\\uF8FF\\u{F0000}-\\u{FFFFD}\\u{100000}-\\u{10FFFD}/?=]").freeze
132
+ # ifragment = *( ipchar / "/" / "?" )
133
+ ENCODE_IFRAGMENT = Regexp.compile("[^A-Za-z0-9\._~#{UCSCHAR}/?]").freeze
134
+
120
135
  ##
121
136
  # Cache size may be set through {RDF.config} using `uri_cache_size`.
122
137
  #
@@ -170,7 +185,7 @@ module RDF
170
185
  # @return [String] normalized path
171
186
  # @see http://tools.ietf.org/html/rfc3986#section-5.2.4
172
187
  def self.normalize_path(path)
173
- output, input = "", path.to_s
188
+ output, input = String.new, path.to_s
174
189
  if input.encoding != Encoding::ASCII_8BIT
175
190
  input = input.dup.force_encoding(Encoding::ASCII_8BIT)
176
191
  end
@@ -353,7 +368,7 @@ module RDF
353
368
  # @return [Boolean] `true` or `false`
354
369
  # @since 0.3.9
355
370
  def valid?
356
- RDF::URI::IRI.match(to_s) || false
371
+ RDF::URI::IRI.match?(to_s) || false
357
372
  end
358
373
 
359
374
  ##
@@ -920,7 +935,7 @@ module RDF
920
935
  # Return normalized version of scheme, if any
921
936
  # @return [String]
922
937
  def normalized_scheme
923
- normalize_segment(scheme.strip, SCHEME, true) if scheme
938
+ scheme.strip.downcase if scheme
924
939
  end
925
940
 
926
941
  ##
@@ -946,7 +961,7 @@ module RDF
946
961
  # Normalized version of user
947
962
  # @return [String]
948
963
  def normalized_user
949
- URI.encode(CGI.unescape(user), /[^#{IUNRESERVED}|#{SUB_DELIMS}]/).force_encoding(Encoding::UTF_8) if user
964
+ URI.encode(CGI.unescape(user), ENCODE_USER).force_encoding(Encoding::UTF_8) if user
950
965
  end
951
966
 
952
967
  ##
@@ -972,7 +987,7 @@ module RDF
972
987
  # Normalized version of password
973
988
  # @return [String]
974
989
  def normalized_password
975
- URI.encode(CGI.unescape(password), /[^#{IUNRESERVED}|#{SUB_DELIMS}]/).force_encoding(Encoding::UTF_8) if password
990
+ URI.encode(CGI.unescape(password), ENCODE_PASSWORD).force_encoding(Encoding::UTF_8) if password
976
991
  end
977
992
 
978
993
  HOST_FROM_AUTHORITY_RE = /(?:[^@]+@)?([^:]+)(?::.*)?$/.freeze
@@ -1000,7 +1015,7 @@ module RDF
1000
1015
  # @return [String]
1001
1016
  def normalized_host
1002
1017
  # Remove trailing '.' characters
1003
- normalize_segment(host, IHOST, true).chomp('.') if host
1018
+ host.sub(/\.*$/, '').downcase if host
1004
1019
  end
1005
1020
 
1006
1021
  PORT_FROM_AUTHORITY_RE = /:(\d+)$/.freeze
@@ -1028,12 +1043,8 @@ module RDF
1028
1043
  # @return [String]
1029
1044
  def normalized_port
1030
1045
  if port
1031
- np = normalize_segment(port.to_s, PORT)
1032
- if PORT_MAPPING[normalized_scheme] == np.to_i
1033
- nil
1034
- else
1035
- np.to_i
1036
- end
1046
+ np = port.to_i
1047
+ PORT_MAPPING[normalized_scheme] != np ? np : nil
1037
1048
  end
1038
1049
  end
1039
1050
 
@@ -1064,30 +1075,36 @@ module RDF
1064
1075
  # Normalized version of path
1065
1076
  # @return [String]
1066
1077
  def normalized_path
1078
+ if normalized_scheme == "urn"
1079
+ # Special-case URI. Normalize the NID component only
1080
+ nid, p = path.to_s.split(':', 2)
1081
+ return "#{nid.downcase}:#{p}"
1082
+ end
1083
+
1067
1084
  segments = path.to_s.split('/', -1) # preserve null segments
1068
1085
 
1069
1086
  norm_segs = case
1070
1087
  when authority
1071
1088
  # ipath-abempty
1072
- segments.map {|s| normalize_segment(s, ISEGMENT)}
1089
+ segments.map {|s| normalize_segment(s, ENCODE_ISEGMENT)}
1073
1090
  when segments[0].nil?
1074
1091
  # ipath-absolute
1075
1092
  res = [nil]
1076
- res << normalize_segment(segments[1], ISEGMENT_NZ) if segments.length > 1
1077
- res += segments[2..-1].map {|s| normalize_segment(s, ISEGMENT)} if segments.length > 2
1093
+ res << normalize_segment(segments[1], ENCODE_ISEGMENT) if segments.length > 1
1094
+ res += segments[2..-1].map {|s| normalize_segment(s, ENCODE_ISEGMENT)} if segments.length > 2
1078
1095
  res
1079
1096
  when segments[0].to_s.index(':')
1080
1097
  # ipath-noscheme
1081
1098
  res = []
1082
- res << normalize_segment(segments[0], ISEGMENT_NZ_NC)
1083
- res += segments[1..-1].map {|s| normalize_segment(s, ISEGMENT)} if segments.length > 1
1099
+ res << normalize_segment(segments[0], ENCODE_ISEGMENT_NC)
1100
+ res += segments[1..-1].map {|s| normalize_segment(s, ENCODE_ISEGMENT)} if segments.length > 1
1084
1101
  res
1085
1102
  when segments[0]
1086
1103
  # ipath-rootless
1087
1104
  # ipath-noscheme
1088
1105
  res = []
1089
- res << normalize_segment(segments[0], ISEGMENT_NZ)
1090
- res += segments[1..-1].map {|s| normalize_segment(s, ISEGMENT)} if segments.length > 1
1106
+ res << normalize_segment(segments[0], ENCODE_ISEGMENT)
1107
+ res += segments[1..-1].map {|s| normalize_segment(s, ENCODE_ISEGMENT)} if segments.length > 1
1091
1108
  res
1092
1109
  else
1093
1110
  # Should be empty
@@ -1096,7 +1113,7 @@ module RDF
1096
1113
 
1097
1114
  res = self.class.normalize_path(norm_segs.join("/"))
1098
1115
  # Special rules for specific protocols having empty paths
1099
- normalize_segment(res.empty? ? (%w(http https ftp tftp).include?(normalized_scheme) ? '/' : "") : res, IHIER_PART)
1116
+ (res.empty? && %w(http https ftp tftp).include?(normalized_scheme)) ? '/' : res
1100
1117
  end
1101
1118
 
1102
1119
  ##
@@ -1120,7 +1137,7 @@ module RDF
1120
1137
  # Normalized version of query
1121
1138
  # @return [String]
1122
1139
  def normalized_query
1123
- normalize_segment(query, IQUERY) if query
1140
+ normalize_segment(query, ENCODE_IQUERY) if query
1124
1141
  end
1125
1142
 
1126
1143
  ##
@@ -1144,7 +1161,7 @@ module RDF
1144
1161
  # Normalized version of fragment
1145
1162
  # @return [String]
1146
1163
  def normalized_fragment
1147
- normalize_segment(fragment, IFRAGMENT) if fragment
1164
+ normalize_segment(fragment, ENCODE_IFRAGMENT) if fragment
1148
1165
  end
1149
1166
 
1150
1167
  ##
@@ -1274,7 +1291,7 @@ module RDF
1274
1291
  self.query = case value
1275
1292
  when Array, Hash
1276
1293
  value.map do |(k,v)|
1277
- k = normalize_segment(k.to_s, UNRESERVED)
1294
+ k = normalize_segment(k.to_s, /[^A-Za-z0-9\._~-]/)
1278
1295
  if v.nil?
1279
1296
  k
1280
1297
  else
@@ -1282,7 +1299,7 @@ module RDF
1282
1299
  if vv === TrueClass
1283
1300
  k
1284
1301
  else
1285
- "#{k}=#{normalize_segment(vv.to_s, UNRESERVED)}"
1302
+ "#{k}=#{normalize_segment(vv.to_s, /[^A-Za-z0-9\._~-]/)}"
1286
1303
  end
1287
1304
  end.join("&")
1288
1305
  end
@@ -1331,7 +1348,7 @@ module RDF
1331
1348
  # Normalize a segment using a character range
1332
1349
  #
1333
1350
  # @param [String] value
1334
- # @param [Regexp] expr
1351
+ # @param [Regexp] expr matches characters to be encoded
1335
1352
  # @param [Boolean] downcase
1336
1353
  # @return [String]
1337
1354
  def normalize_segment(value, expr, downcase = false)
@@ -1339,7 +1356,7 @@ module RDF
1339
1356
  value = value.dup.force_encoding(Encoding::UTF_8)
1340
1357
  decoded = CGI.unescape(value)
1341
1358
  decoded.downcase! if downcase
1342
- URI.encode(decoded, /[^(?:#{expr})]/).force_encoding(Encoding::UTF_8)
1359
+ URI.encode(decoded, expr).force_encoding(Encoding::UTF_8)
1343
1360
  end
1344
1361
  end
1345
1362
 
@@ -1364,7 +1381,7 @@ module RDF
1364
1381
  def self.encode(str, expr)
1365
1382
  str.gsub(expr) do
1366
1383
  us = $&
1367
- tmp = ''
1384
+ tmp = String.new
1368
1385
  us.each_byte do |uc|
1369
1386
  tmp << sprintf('%%%02X', uc)
1370
1387
  end
@@ -125,16 +125,18 @@ module RDF::NTriples
125
125
  # @see http://www.w3.org/TR/n-triples/
126
126
  def self.escape_ascii(u, encoding)
127
127
  case (u = u.ord)
128
- when (0x00..0x07) then escape_utf16(u)
129
- when (0x0A) then "\\n"
130
- when (0x0D) then "\\r"
131
- when (0x0E..0x1F) then escape_utf16(u)
132
- when (0x22) then "\\\""
133
- when (0x5C) then "\\\\"
134
- when (0x7F) then escape_utf16(u)
135
- when (0x00..0x7F) then u.chr
136
- else
137
- raise ArgumentError.new("expected an ASCII character in (0x00..0x7F), but got 0x#{u.to_s(16)}")
128
+ when (0x08) then "\\b"
129
+ when (0x09) then "\\t"
130
+ when (0x0A) then "\\n"
131
+ when (0x0C) then "\\f"
132
+ when (0x0D) then "\\r"
133
+ when (0x22) then "\\\""
134
+ when (0x5C) then "\\\\"
135
+ when (0x00..0x1F) then escape_utf16(u)
136
+ when (0x7F) then escape_utf16(u)
137
+ when (0x20..0x7E) then u.chr
138
+ else
139
+ raise ArgumentError.new("expected an ASCII character in (0x00..0x7F), but got 0x#{u.to_s(16)}")
138
140
  end
139
141
  end
140
142
 
@@ -85,7 +85,7 @@ module RDF; module Util
85
85
  id = value.__id__
86
86
  @cache[key] = id
87
87
  @index[id] = key
88
- ObjectSpace.define_finalizer(value, proc {|id| @cache.delete(@index.delete(id))})
88
+ ObjectSpace.define_finalizer(value, finalizer_proc)
89
89
  end
90
90
  value
91
91
  end
@@ -100,6 +100,12 @@ module RDF; module Util
100
100
  @cache.delete(key)
101
101
  @index.delete(id) if id
102
102
  end
103
+
104
+ private
105
+
106
+ def finalizer_proc
107
+ proc { |id| @cache.delete(@index.delete(id)) }
108
+ end
103
109
  end # ObjectSpaceCache
104
110
 
105
111
  ##
@@ -121,7 +127,7 @@ module RDF; module Util
121
127
  def [](key)
122
128
  if (ref = @cache[key])
123
129
  if ref.weakref_alive?
124
- value = ref.__getobj__ rescue nil
130
+ ref.__getobj__ rescue nil
125
131
  else
126
132
  @cache.delete(key)
127
133
  nil
@@ -181,10 +181,10 @@ module RDF; module Util
181
181
  end
182
182
 
183
183
  ##
184
- # @overload log_depth(options, &block)
184
+ # @overload log_depth(depth: 1, **options, &block)
185
185
  # Increase depth around a method invocation
186
+ # @param [Integer] :depth Additional recursion depth
186
187
  # @param [Hash{Symbol}] options (@options || {})
187
- # @option options [Integer] :depth Additional recursion depth
188
188
  # @option options [Logger, #<<] :logger
189
189
  # @yield
190
190
  # Yields with no arguments
@@ -194,8 +194,8 @@ module RDF; module Util
194
194
  # @overload log_depth
195
195
  # # Return the current log depth
196
196
  # @return [Integer]
197
- def log_depth(**options, &block)
198
- self.logger(**options).log_depth(&block)
197
+ def log_depth(depth: 1, **options, &block)
198
+ self.logger(**options).log_depth(depth: depth, &block)
199
199
  end
200
200
 
201
201
  private
@@ -244,7 +244,7 @@ module RDF; module Util
244
244
  end
245
245
 
246
246
  ##
247
- # @overload log_depth(options, &block)
247
+ # @overload log_depth(depth: 1, **options, &block)
248
248
  # Increase depth around a method invocation
249
249
  # @param [Integer] depth (1) recursion depth
250
250
  # @param [Hash{Symbol}] options (@options || {})
data/lib/rdf/util/uuid.rb CHANGED
@@ -22,11 +22,11 @@ module RDF; module Util
22
22
  begin
23
23
  require 'uuid'
24
24
  ::UUID.generate(format)
25
- rescue LoadError => e
25
+ rescue LoadError
26
26
  begin
27
27
  require 'uuidtools'
28
28
  ::UUIDTools::UUID.random_create.hexdigest
29
- rescue LoadError => e
29
+ rescue LoadError
30
30
  raise LoadError.new("no such file to load -- uuid or uuidtools")
31
31
  end
32
32
  end
data/lib/rdf.rb CHANGED
@@ -5,7 +5,6 @@ require 'time'
5
5
  require "ostruct"
6
6
 
7
7
  require 'rdf/version'
8
- require 'rdf/extensions'
9
8
 
10
9
  module RDF
11
10
  # RDF mixins
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.9
4
+ version: 3.2.11
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-08-07 00:00:00.000000000 Z
13
+ date: 2023-06-07 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: link_header
@@ -114,14 +114,14 @@ dependencies:
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: '3.10'
117
+ version: '3.12'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: '3.10'
124
+ version: '3.12'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: rspec-its
127
127
  requirement: !ruby/object:Gem::Requirement
@@ -142,14 +142,14 @@ dependencies:
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: '3.14'
145
+ version: '3.18'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: '3.14'
152
+ version: '3.18'
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: yard
155
155
  requirement: !ruby/object:Gem::Requirement
@@ -170,14 +170,14 @@ dependencies:
170
170
  requirements:
171
171
  - - "~>"
172
172
  - !ruby/object:Gem::Version
173
- version: '1.8'
173
+ version: '1.10'
174
174
  type: :development
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - "~>"
179
179
  - !ruby/object:Gem::Version
180
- version: '1.8'
180
+ version: '1.10'
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: faraday_middleware
183
183
  requirement: !ruby/object:Gem::Requirement
@@ -210,7 +210,6 @@ files:
210
210
  - lib/rdf.rb
211
211
  - lib/rdf/changeset.rb
212
212
  - lib/rdf/cli.rb
213
- - lib/rdf/extensions.rb
214
213
  - lib/rdf/format.rb
215
214
  - lib/rdf/mixin/countable.rb
216
215
  - lib/rdf/mixin/durable.rb
@@ -295,7 +294,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
295
294
  - !ruby/object:Gem::Version
296
295
  version: '0'
297
296
  requirements: []
298
- rubygems_version: 3.3.3
297
+ rubygems_version: 3.4.10
299
298
  signing_key:
300
299
  specification_version: 4
301
300
  summary: A Ruby library for working with Resource Description Framework (RDF) data.
@@ -1,22 +0,0 @@
1
- ##
2
- # This file provides compatibility monkeypatches to standard library classes
3
- # Implementation taken from MIT-licensed https://github.com/marcandre/backports
4
- #
5
-
6
- # https://github.com/marcandre/backports/blob/master/lib/backports/2.4.0/regexp/match.rb
7
- unless Regexp.method_defined? :match?
8
- class Regexp
9
- def match?(*args)
10
- !match(*args).nil?
11
- end
12
- end
13
- end
14
-
15
- # https://github.com/marcandre/backports/blob/master/lib/backports/2.4.0/string/match.rb
16
- unless String.method_defined? :match?
17
- class String
18
- def match?(*args)
19
- !match(*args).nil?
20
- end
21
- end
22
- end