fair_champion_harvester 0.1.8 → 0.1.9

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: b1c70e6bdfe3da0cb1d599ed1abbe72617f742f4b68a1b55498c4b966f773496
4
- data.tar.gz: 57a0701bc5ec4fef3f1b9130b8d0e7c4032d6b1d6995160658fe160c7b19a370
3
+ metadata.gz: 07365a6c33e7c66a530b30ea4b6e947a8355e3b378e4e88c7609942864adf98a
4
+ data.tar.gz: 20df41a8f201c1e74d882bf17e40e942119b77d88f4d935281e572b7e73d175f
5
5
  SHA512:
6
- metadata.gz: 817c52a44a7749080011f97da8f31ca125b203fa9b286ef967256e0d21f8de017f1b4aa4cf3493ac25cb736f3bd263cc77303bda7fbf75537532bf4057d364df
7
- data.tar.gz: e07bb61d39a521d6f6911a3ac7d8bd5fcbdf0691effa360d112d9b9fc2893cc0a9fda25cfa7761e329ef3ec5cd17eddd8586bfab2f3cc469aabe72b0eac6a05b
6
+ metadata.gz: d4eddba2884a2f87fbf1aac1a005c2794061e43920fab8d38bc55a3e9eb5a81bc65ee16f33e6e4c507a5d8608f183026e6a696a63dd7c3a938b41ed6d289a039
7
+ data.tar.gz: 61648adf249a8ffe45184486564bfcf63a443c859f1eb43cd4222ada73e5f88d66b35b88866c85c76d369650dca54036da1180ff56d754c8cd462e1195bf8885
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FairChampionHarvester
4
- VERSION = "0.1.8"
4
+ VERSION = "0.1.9"
5
5
  end
data/lib/harvester.rb CHANGED
@@ -197,7 +197,7 @@ module FAIRChampionHarvester
197
197
  links = headers[:link]
198
198
  return [] unless links
199
199
 
200
- parts = links.split(",")
200
+ parts = Array(links).flat_map { |l| l.split(",") }
201
201
 
202
202
  urls = []
203
203
  # Parse each part into a named link
@@ -205,17 +205,18 @@ module FAIRChampionHarvester
205
205
  section = part.split(";")
206
206
  next unless section[0]
207
207
 
208
- url = section[0][/<(.*)>/, 1]
208
+ url = section[0][/<([^>]*)>/, 1]
209
+ next unless url
209
210
  next unless section[1]
210
211
 
211
- type = ""
212
+ type = nil
212
213
  section[1..].each do |s|
213
- type = s[/rel="?(\w+)"?/, 1]
214
+ type = s[/rel="?([\w-]+)"?/, 1]
214
215
  break if type
215
216
  end
216
217
  next unless type
217
218
  # "meta" headers are for old versions of Virtuoso LDP - not in link relations standared
218
- next unless %w[meta alternate].include?(type.downcase)
219
+ next unless %w[meta alternate describedby].include?(type.downcase)
219
220
 
220
221
  urls << url
221
222
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fair_champion_harvester
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - markwilkinson