linkheaders-processor 0.1.17 → 0.1.18
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 +4 -4
- data/Gemfile.lock +2 -2
- data/lib/linkheaders/processor/version.rb +1 -1
- data/lib/linkheaders/processor.rb +4 -6
- 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: c8eb95bf3880ef8dba373d47230b512d5209bcde19581c1064c2cb703bab3abf
|
4
|
+
data.tar.gz: 3ac9096ab4487e30f5e8a78a18cd982f47e232f4dc7e8b9d9573b73ee96b63ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6de8bcfd72fb78d76483fe9473ece432ccfc6de1cd68eb1ceda5509ec7324e9c010f60a8c996c335c4164cc920a23b046c8ea1a0f9b6edd08f55acfe17e7caca
|
7
|
+
data.tar.gz: 557b9ff9c6f9da8a7f28d3f01e9079f14caf205fe14b017bcc0aa2902b80a89cd32207e98e4ec2642e9d08aae112c22c6835e0821fb7acc1282a3e620771f0cf
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
linkheaders-processor (0.1.
|
4
|
+
linkheaders-processor (0.1.18)
|
5
5
|
json (~> 2.0)
|
6
6
|
json-ld (~> 3.2)
|
7
7
|
json-ld-preloaded (~> 3.2)
|
@@ -39,7 +39,7 @@ GEM
|
|
39
39
|
faraday-encoding (0.0.5)
|
40
40
|
faraday
|
41
41
|
faraday-excon (1.1.0)
|
42
|
-
faraday-http-cache (2.4.
|
42
|
+
faraday-http-cache (2.4.1)
|
43
43
|
faraday (>= 0.8)
|
44
44
|
faraday-httpclient (1.0.1)
|
45
45
|
faraday-multipart (1.0.4)
|
@@ -245,13 +245,13 @@ module LinkHeaders
|
|
245
245
|
# warn "linkset body #{linkset.inspect}"
|
246
246
|
return {} unless linkset
|
247
247
|
|
248
|
-
links = linkset.scan(/(<.*?>[^<]+)/) # split on the open angle bracket, which indicates a new link
|
248
|
+
# links = linkset.scan(/(<.*?>[^<]+)/) # split on the open angle bracket, which indicates a new link
|
249
|
+
links = linkset.split(/,\n*/) # split on the comma+newline
|
249
250
|
# warn "Links found #{links}"
|
250
251
|
|
251
252
|
links.each do |ls|
|
252
|
-
# warn "
|
253
|
-
|
254
|
-
elements = ls.split(';') # semicolon delimited fields
|
253
|
+
# warn "working on link #{ls}"
|
254
|
+
elements = ls.split(';').map {|element| element.strip!} # semicolon delimited fields
|
255
255
|
# ["<https://w3id.org/a2a-fair-metrics/08-http-describedby-citeas-linkset-txt/>", "anchor=\"https://s11.no/2022/a2a-fair-metrics/08-http-describedby-citeas-linkset-txt/\"", "rel=\"cite-as\""]
|
256
256
|
href = elements.shift # first element is always the link url
|
257
257
|
# warn "working on link href #{href}"
|
@@ -259,8 +259,6 @@ module LinkHeaders
|
|
259
259
|
attrhash = {}
|
260
260
|
elements.each do |e|
|
261
261
|
key, val = e.split('=')
|
262
|
-
key.strip!
|
263
|
-
val.strip!
|
264
262
|
val.delete_prefix!('"').delete_suffix!('"') # get rid of newlines and start/end quotes
|
265
263
|
attrhash[key.to_sym] = val # split on key=val and make key a symbol
|
266
264
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: linkheaders-processor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Wilkinson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-08-
|
11
|
+
date: 2022-08-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|