linkheaders-processor 0.1.16 → 0.1.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +5 -5
- data/lib/linkheaders/processor/version.rb +1 -1
- data/lib/linkheaders/processor.rb +5 -5
- 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: b10f24c0498058f393a2142465f0ff2e559dc2a8721ea8cf6a90178c8ff21789
|
4
|
+
data.tar.gz: 5cd760d37f6e82f63cb8271375bec72364264173010fda86e1ae32f1a424642d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e696571f2c9da932ff461af46740824de0728a6accd327ab6e109ab84530d313868d120cff5a62f670655efe6531069d7b6a358f1dcfcb94560cdd647614ff35
|
7
|
+
data.tar.gz: cf056d618d352bbcfaa43e59317fbc6f739186ac3e7ae26534e8f12721dec0d7ab2e8edfa07a2434e881a37d1cd18bf30e84f6cfac402fcc74ecd8c86170fa73
|
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.17)
|
5
5
|
json (~> 2.0)
|
6
6
|
json-ld (~> 3.2)
|
7
7
|
json-ld-preloaded (~> 3.2)
|
@@ -19,7 +19,7 @@ GEM
|
|
19
19
|
diff-lcs (1.5.0)
|
20
20
|
domain_name (0.5.20190701)
|
21
21
|
unf (>= 0.0.5, < 1.0.0)
|
22
|
-
faraday (1.10.
|
22
|
+
faraday (1.10.1)
|
23
23
|
faraday-em_http (~> 1.0)
|
24
24
|
faraday-em_synchrony (~> 1.0)
|
25
25
|
faraday-excon (~> 1.1)
|
@@ -58,13 +58,13 @@ GEM
|
|
58
58
|
domain_name (~> 0.5)
|
59
59
|
json (2.6.2)
|
60
60
|
json-canonicalization (0.3.0)
|
61
|
-
json-ld (3.2.
|
61
|
+
json-ld (3.2.3)
|
62
62
|
htmlentities (~> 4.3)
|
63
63
|
json-canonicalization (~> 0.3)
|
64
64
|
link_header (~> 0.0, >= 0.0.8)
|
65
65
|
multi_json (~> 1.15)
|
66
66
|
rack (~> 2.2)
|
67
|
-
rdf (~> 3.2)
|
67
|
+
rdf (~> 3.2, >= 3.2.9)
|
68
68
|
json-ld-preloaded (3.2.0)
|
69
69
|
json-ld (~> 3.2)
|
70
70
|
rdf (~> 3.2)
|
@@ -96,7 +96,7 @@ GEM
|
|
96
96
|
rack (2.2.4)
|
97
97
|
rainbow (3.1.1)
|
98
98
|
rake (13.0.6)
|
99
|
-
rdf (3.2.
|
99
|
+
rdf (3.2.9)
|
100
100
|
link_header (~> 0.0, >= 0.0.8)
|
101
101
|
regexp_parser (2.5.0)
|
102
102
|
rest-client (2.1.0)
|
@@ -65,7 +65,7 @@ module LinkHeaders
|
|
65
65
|
['text/html','text/xhtml+xml', 'application/xhtml+xml'].each do |format|
|
66
66
|
if head[:content_type] and head[:content_type].match(format)
|
67
67
|
warn "found #{format} content - parsing"
|
68
|
-
htmllinks = parse_html_link_headers(body) # pass html body to find HTML link headers
|
68
|
+
htmllinks = parse_html_link_headers(body: body, anchor: default_anchor) # pass html body to find HTML link headers
|
69
69
|
warn "htmllinks #{htmllinks.inspect}"
|
70
70
|
end
|
71
71
|
end
|
@@ -123,7 +123,7 @@ module LinkHeaders
|
|
123
123
|
relation = sections['rel']
|
124
124
|
sections.delete('rel')
|
125
125
|
relations = relation.split(/\s+/) # handle the multiple relation case
|
126
|
-
|
126
|
+
warn "RELATIONS #{relations}"
|
127
127
|
|
128
128
|
relations.each do |rel|
|
129
129
|
next unless rel.match?(/\w/)
|
@@ -138,8 +138,8 @@ module LinkHeaders
|
|
138
138
|
#
|
139
139
|
# @param [String] body The HTML of the page containing HTML Link headers
|
140
140
|
#
|
141
|
-
def parse_html_link_headers(body)
|
142
|
-
m = MetaInspector.new(
|
141
|
+
def parse_html_link_headers(body:, anchor: '')
|
142
|
+
m = MetaInspector.new(anchor, document: body)
|
143
143
|
# an array of elements that look like this: [{:rel=>"alternate", :type=>"application/ld+json", :href=>"http://scidata.vitk.lv/dataset/303.jsonld"}]
|
144
144
|
newlinks = Array.new
|
145
145
|
m.head_links.each do |l|
|
@@ -154,7 +154,7 @@ module LinkHeaders
|
|
154
154
|
l.delete(:href)
|
155
155
|
|
156
156
|
relations = relation.split(/\s+/) # handle the multiple relation case
|
157
|
-
|
157
|
+
warn "RELATIONS #{relations}"
|
158
158
|
|
159
159
|
relations.each do |rel|
|
160
160
|
next unless rel.match?(/\w/)
|
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.17
|
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-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|