rdf 3.1.3 → 3.1.4

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: 3edf1c89289474f1f14ee840b6cd5903c6443afd7ad8121e3ddfce5bcae30895
4
- data.tar.gz: 12497c16ebc49b1bcfaa404609389b8c98cea22233868ff1378a810ede686371
3
+ metadata.gz: 6ecf8b966bcaf7510f41e9abcfa06b9fc2ba8bf6f135452055d4070374d8d277
4
+ data.tar.gz: 040d4fd90f753fb7775de4faa323dbdf611b72b106c2d739fe49da2782654bf2
5
5
  SHA512:
6
- metadata.gz: de42189a4269854a6292b4cd0b0de0a07c0a0d0e5b61a40cc9b4f460b66ada2f090fbadb0486e48d183f366ce776ea88ff89f715f61439c8c5ad7857d24047cb
7
- data.tar.gz: 20725ce63013fed6385e9e1aade5b808d821de4ef5986cedbf9b87c34cc9f749b132437e2b7e496da12774214b709d6d3accf9b0861c14fa3353452ca5e0cbf5
6
+ metadata.gz: 6fef455fbd5119f38c8591b88efd49856fb595ad2a1a35d0aa8124d7ca42f19e30a2e655829b633e362e5fba9723acbb2bb171aa6f0e2176ddd721a18e147ce7
7
+ data.tar.gz: ff5f59ab46447637a367f3355aadd005944457c6832264130ab9b9d6566f0ca0eff6a71245562d68de05e46e7cc6a97d74e447df1ff9918b0f4135d3e402f350
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.1.3
1
+ 3.1.4
@@ -1,5 +1,5 @@
1
1
  # coding: utf-8
2
- require 'uri'
2
+ require 'cgi'
3
3
 
4
4
  module RDF
5
5
  ##
@@ -846,7 +846,7 @@ module RDF
846
846
  parts[:user] = (user.dup.force_encoding(Encoding::UTF_8) if user)
847
847
  parts[:password] = (password.dup.force_encoding(Encoding::UTF_8) if password)
848
848
  parts[:host] = (host.dup.force_encoding(Encoding::UTF_8) if host)
849
- parts[:port] = (URI.decode(port).to_i if port)
849
+ parts[:port] = (CGI.unescape(port).to_i if port)
850
850
  parts[:path] = (path.to_s.dup.force_encoding(Encoding::UTF_8) unless path.empty?)
851
851
  parts[:query] = (query[1..-1].dup.force_encoding(Encoding::UTF_8) if query)
852
852
  parts[:fragment] = (fragment[1..-1].dup.force_encoding(Encoding::UTF_8) if fragment)
@@ -902,7 +902,7 @@ module RDF
902
902
  # Normalized version of user
903
903
  # @return [String]
904
904
  def normalized_user
905
- URI.encode(URI.decode(user), /[^#{IUNRESERVED}|#{SUB_DELIMS}]/) if user
905
+ URI.encode(CGI.unescape(user), /[^#{IUNRESERVED}|#{SUB_DELIMS}]/) if user
906
906
  end
907
907
 
908
908
  ##
@@ -928,7 +928,7 @@ module RDF
928
928
  # Normalized version of password
929
929
  # @return [String]
930
930
  def normalized_password
931
- URI.encode(URI.decode(password), /[^#{IUNRESERVED}|#{SUB_DELIMS}]/) if password
931
+ URI.encode(CGI.unescape(password), /[^#{IUNRESERVED}|#{SUB_DELIMS}]/) if password
932
932
  end
933
933
 
934
934
  HOST_FROM_AUTHORITY_RE = /(?:[^@]+@)?([^:]+)(?::.*)?$/.freeze
@@ -1180,8 +1180,8 @@ module RDF
1180
1180
  inject(return_type == Hash ? {} : []) do |memo,kv|
1181
1181
  k,v = kv.to_s.split('=', 2)
1182
1182
  next if k.to_s.empty?
1183
- k = URI.decode(k)
1184
- v = URI.decode(v) if v
1183
+ k = CGI.unescape(k)
1184
+ v = CGI.unescape(v) if v
1185
1185
  if return_type == Hash
1186
1186
  case memo[k]
1187
1187
  when nil then memo[k] = v
@@ -1293,7 +1293,7 @@ module RDF
1293
1293
  def normalize_segment(value, expr, downcase = false)
1294
1294
  if value
1295
1295
  value = value.dup.force_encoding(Encoding::UTF_8)
1296
- decoded = URI.decode(value)
1296
+ decoded = CGI.unescape(value)
1297
1297
  decoded.downcase! if downcase
1298
1298
  URI.encode(decoded, /[^(?:#{expr})]/)
1299
1299
  end
@@ -1,4 +1,7 @@
1
1
  # -*- encoding: utf-8 -*-
2
+
3
+ require 'strscan'
4
+
2
5
  module RDF::NTriples
3
6
  ##
4
7
  # N-Triples parser.
@@ -219,9 +219,9 @@ module RDF; module Util
219
219
  # @return [void]
220
220
  def logger_common(*args, level:, **options)
221
221
  logger = self.logger(**options)
222
- logger.log_statistics[level] = logger.log_statistics[level].to_i + 1
223
222
  # Some older code uses integer level numbers
224
223
  level = LOGGER_COMMON_LEVELS_REVERSE.fetch(level) if level.is_a?(Integer)
224
+ logger.log_statistics[level] = logger.log_statistics[level].to_i + 1
225
225
  return if logger.level > LOGGER_COMMON_LEVELS.fetch(level)
226
226
 
227
227
  depth = options.fetch(:depth, logger.log_depth)
@@ -1,5 +1,6 @@
1
1
  require 'rdf'
2
2
  require 'rdf/vocabulary'
3
+ require 'cgi'
3
4
 
4
5
  module RDF
5
6
  ##
@@ -84,7 +85,7 @@ module RDF
84
85
  on: ["--extra URIEncodedJSON"],
85
86
  description: "URI Encoded JSON representation of extra data"
86
87
  ) do |arg|
87
- ::JSON.parse(::URI.decode(arg)).inject({}) do |m1, (term, defs)|
88
+ ::JSON.parse(::CGI.unescape(arg)).inject({}) do |m1, (term, defs)|
88
89
  d1 = defs.inject({}) {|m, (k,v)| m.merge(k.to_sym => v)}
89
90
  m1.merge(term.to_sym => d1)
90
91
  end
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.1.3
4
+ version: 3.1.4
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: 2020-06-16 00:00:00.000000000 Z
13
+ date: 2020-07-01 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: link_header