html-proofer 3.17.2 → 3.17.3

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: ee53fc4edb91d7319f27f79abf9c31a10761b19fdbabf25904048fd4a1f3f2b5
4
- data.tar.gz: a779feb72397f9f7b3498702ba6097437ca4162fe95e9c618df2c32df317196f
3
+ metadata.gz: 78c779b0dfc11fd1d80baaf4133ee26b695e13fcb20ed3852cb99a65caef7e24
4
+ data.tar.gz: 71e4f5e229d8754bc1ad01d4dc28d76ae43f0c5c2d0e3ff2871c32ae4ce89c42
5
5
  SHA512:
6
- metadata.gz: 1caec4616e73928e36e32cedc4529b0ad4628d5ff22b0b060f14d967f9e778fbad9cfdc1b3cc22aa302ea9e7509eb3d7bbaffeacc7f95541cede0bb1c875a3fa
7
- data.tar.gz: e33a43f7e5fcbe892acf02c89950715d5b34e2d11430507ab83574126e9568a32a57a238727fa047153d7f4824baba9d62dbf2839655fd49c28ac50bb1469eea
6
+ metadata.gz: aa82fcbba561ef4107dce9188d2c451ee8c40afbf5ff67dbd4f98729f91fec40ce3b58f2e13fd04a9e2f91258757f283240680cbf7b609e2c3b7000168b2fff6
7
+ data.tar.gz: 848b2d731f440c3128c77e4cdddcb54ffc18cf1fdd423afc63b9300ccf074ad457b0064b70aab59d950ea242ba3e01b2ff33f8e02491859c24f23d5895f6f705
@@ -26,8 +26,8 @@ module HTMLProofer
26
26
  raise NotImplementedError, 'HTMLProofer::Check subclasses must implement #run'
27
27
  end
28
28
 
29
- def add_issue(desc, line: nil, status: -1, content: nil)
30
- @issues << Issue.new(@path, desc, line: line, status: status, content: content)
29
+ def add_issue(desc, line: nil, path: nil, status: -1, content: nil)
30
+ @issues << Issue.new(path || @path, desc, line: line, status: status, content: content)
31
31
  false
32
32
  end
33
33
 
@@ -7,7 +7,7 @@ class FaviconCheck < ::HTMLProofer::Check
7
7
  favicon = create_element(node)
8
8
  next if favicon.ignore?
9
9
 
10
- found = true if favicon.rel.split(' ').last.eql? 'icon'
10
+ found = true if favicon.rel.split.last.eql? 'icon'
11
11
  break if found
12
12
  end
13
13
 
@@ -65,15 +65,15 @@ class LinkCheck < ::HTMLProofer::Check
65
65
  external_urls
66
66
  end
67
67
 
68
- def check_internal_link(link, line, content)
68
+ def check_internal_link(link, path, line, content)
69
69
  # does the local directory have a trailing slash?
70
70
  if link.unslashed_directory?(link.absolute_path)
71
- add_issue("internally linking to a directory #{link.absolute_path} without trailing slash", line: line, content: content)
71
+ add_issue("internally linking to a directory #{link.absolute_path} without trailing slash", path: path, line: line, content: content)
72
72
  return false
73
73
  end
74
74
 
75
75
  # verify the target hash
76
- return handle_hash(link, line, content) if link.hash
76
+ return handle_hash(link, path, line, content) if link.hash
77
77
 
78
78
  true
79
79
  end
@@ -103,9 +103,9 @@ class LinkCheck < ::HTMLProofer::Check
103
103
  add_issue("#{link.href} contains no phone number", line: line, content: content) if link.path.empty?
104
104
  end
105
105
 
106
- def handle_hash(link, line, content)
106
+ def handle_hash(link, path, line, content)
107
107
  if link.internal? && !hash_exists?(link.html, link.hash) # rubocop:disable Style/GuardClause
108
- return add_issue("linking to internal hash ##{link.hash} that does not exist", line: line, content: content)
108
+ return add_issue("linking to internal hash ##{link.hash} that does not exist", path: path, line: line, content: content)
109
109
  elsif link.external?
110
110
  return external_link_check(link, line, content)
111
111
  end
@@ -60,7 +60,7 @@ module HTMLProofer
60
60
  body = []
61
61
  result.last.each { |e| body << e }
62
62
 
63
- body = body.join('')
63
+ body = body.join
64
64
  begin
65
65
  html = body.lstrip
66
66
  rescue StandardError
@@ -147,14 +147,14 @@ module HTMLProofer
147
147
  urls_to_check = load_internal_cache
148
148
 
149
149
  urls_to_check.each_pair do |url, internal_urls|
150
- result = @internal_link_checks.check_internal_link(internal_urls.first.link, internal_urls.first.line, internal_urls.first.content)
150
+ result = @internal_link_checks.check_internal_link(internal_urls.first.link, internal_urls.first.path, internal_urls.first.line, internal_urls.first.content)
151
151
  code = result ? 200 : 404
152
152
  @cache.add(url, @internal_urls_to_paths[url].sort, code, '') # TODO: blank msg for now
153
153
  end
154
154
  @cache.write
155
155
  else
156
156
  @internal_urls.values.flatten.each do |internal_url|
157
- @internal_link_checks.check_internal_link(internal_url.link, internal_url.line, internal_url.content)
157
+ @internal_link_checks.check_internal_link(internal_url.link, internal_url.path, internal_url.line, internal_url.content)
158
158
  end
159
159
  end
160
160
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HTMLProofer
4
- VERSION = '3.17.2'
4
+ VERSION = '3.17.3'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: html-proofer
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.17.2
4
+ version: 3.17.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen Torikian
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-23 00:00:00.000000000 Z
11
+ date: 2020-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -122,20 +122,6 @@ dependencies:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
- - !ruby/object:Gem::Dependency
126
- name: codecov
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - ">="
130
- - !ruby/object:Gem::Version
131
- version: '0'
132
- type: :development
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - ">="
137
- - !ruby/object:Gem::Version
138
- version: '0'
139
125
  - !ruby/object:Gem::Dependency
140
126
  name: pry-byebug
141
127
  requirement: !ruby/object:Gem::Requirement