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 +4 -4
- data/VERSION +1 -1
- data/lib/rdf/model/uri.rb +7 -7
- data/lib/rdf/ntriples/reader.rb +3 -0
- data/lib/rdf/util/logger.rb +1 -1
- data/lib/rdf/vocab/writer.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ecf8b966bcaf7510f41e9abcfa06b9fc2ba8bf6f135452055d4070374d8d277
|
4
|
+
data.tar.gz: 040d4fd90f753fb7775de4faa323dbdf611b72b106c2d739fe49da2782654bf2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6fef455fbd5119f38c8591b88efd49856fb595ad2a1a35d0aa8124d7ca42f19e30a2e655829b633e362e5fba9723acbb2bb171aa6f0e2176ddd721a18e147ce7
|
7
|
+
data.tar.gz: ff5f59ab46447637a367f3355aadd005944457c6832264130ab9b9d6566f0ca0eff6a71245562d68de05e46e7cc6a97d74e447df1ff9918b0f4135d3e402f350
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.1.
|
1
|
+
3.1.4
|
data/lib/rdf/model/uri.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# coding: utf-8
|
2
|
-
require '
|
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] = (
|
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(
|
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(
|
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 =
|
1184
|
-
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 =
|
1296
|
+
decoded = CGI.unescape(value)
|
1297
1297
|
decoded.downcase! if downcase
|
1298
1298
|
URI.encode(decoded, /[^(?:#{expr})]/)
|
1299
1299
|
end
|
data/lib/rdf/ntriples/reader.rb
CHANGED
data/lib/rdf/util/logger.rb
CHANGED
@@ -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)
|
data/lib/rdf/vocab/writer.rb
CHANGED
@@ -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(::
|
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.
|
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-
|
13
|
+
date: 2020-07-01 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: link_header
|