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 +4 -4
- data/lib/fair_champion_harvester/version.rb +1 -1
- data/lib/harvester.rb +6 -5
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 07365a6c33e7c66a530b30ea4b6e947a8355e3b378e4e88c7609942864adf98a
|
|
4
|
+
data.tar.gz: 20df41a8f201c1e74d882bf17e40e942119b77d88f4d935281e572b7e73d175f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d4eddba2884a2f87fbf1aac1a005c2794061e43920fab8d38bc55a3e9eb5a81bc65ee16f33e6e4c507a5d8608f183026e6a696a63dd7c3a938b41ed6d289a039
|
|
7
|
+
data.tar.gz: 61648adf249a8ffe45184486564bfcf63a443c859f1eb43cd4222ada73e5f88d66b35b88866c85c76d369650dca54036da1180ff56d754c8cd462e1195bf8885
|
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][/<(
|
|
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
|