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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ef79d8492d08ea54cc8c23067d4f3c443dee0941f5d901007928d62df93d8073
4
- data.tar.gz: ec81315a8baedf8ea2b0ffdc1c882d44647ca45b0a2a5a1f71734c47ce3d9f64
3
+ metadata.gz: b10f24c0498058f393a2142465f0ff2e559dc2a8721ea8cf6a90178c8ff21789
4
+ data.tar.gz: 5cd760d37f6e82f63cb8271375bec72364264173010fda86e1ae32f1a424642d
5
5
  SHA512:
6
- metadata.gz: 0b510601d2b51739b893b07c546d1ed723dd2bef296c3af59b7fdc3dbfdcfdc08f8e20741c6f2f9ca0957675c02c9ddfb6d5a21201976f256b1b2a45ee7dde2b
7
- data.tar.gz: d20ed0c9b8b04607b104aad8ce5a07c26cc12ae16b925c9ccd3e9feca78f691592976a352ac301a907d517eb55b8972960b7cec4fc3913316c9453f1d2549098
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.16)
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.0)
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.1)
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.8)
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)
@@ -3,6 +3,6 @@
3
3
 
4
4
  module LinkHeaders
5
5
  class Processor
6
- VERSION = "0.1.16"
6
+ VERSION = "0.1.17"
7
7
  end
8
8
  end
@@ -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
- $stderr.puts "RELATIONS #{relations}"
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('http://example.org', document: body)
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
- $stderr.puts "RELATIONS #{relations}"
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.16
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-05 00:00:00.000000000 Z
11
+ date: 2022-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec