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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b10f24c0498058f393a2142465f0ff2e559dc2a8721ea8cf6a90178c8ff21789
4
- data.tar.gz: 5cd760d37f6e82f63cb8271375bec72364264173010fda86e1ae32f1a424642d
3
+ metadata.gz: c8eb95bf3880ef8dba373d47230b512d5209bcde19581c1064c2cb703bab3abf
4
+ data.tar.gz: 3ac9096ab4487e30f5e8a78a18cd982f47e232f4dc7e8b9d9573b73ee96b63ad
5
5
  SHA512:
6
- metadata.gz: e696571f2c9da932ff461af46740824de0728a6accd327ab6e109ab84530d313868d120cff5a62f670655efe6531069d7b6a358f1dcfcb94560cdd647614ff35
7
- data.tar.gz: cf056d618d352bbcfaa43e59317fbc6f739186ac3e7ae26534e8f12721dec0d7ab2e8edfa07a2434e881a37d1cd18bf30e84f6cfac402fcc74ecd8c86170fa73
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.17)
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.0)
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)
@@ -3,6 +3,6 @@
3
3
 
4
4
  module LinkHeaders
5
5
  class Processor
6
- VERSION = "0.1.17"
6
+ VERSION = "0.1.18"
7
7
  end
8
8
  end
@@ -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 "workking on link #{ls}"
253
- ls = ls.first # ls is a single element array
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.17
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-12 00:00:00.000000000 Z
11
+ date: 2022-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec