html-proofer 3.17.2 → 3.17.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/html-proofer/check.rb +2 -2
- data/lib/html-proofer/check/favicon.rb +1 -1
- data/lib/html-proofer/check/links.rb +5 -5
- data/lib/html-proofer/middleware.rb +1 -1
- data/lib/html-proofer/runner.rb +2 -2
- data/lib/html-proofer/version.rb +1 -1
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78c779b0dfc11fd1d80baaf4133ee26b695e13fcb20ed3852cb99a65caef7e24
|
4
|
+
data.tar.gz: 71e4f5e229d8754bc1ad01d4dc28d76ae43f0c5c2d0e3ff2871c32ae4ce89c42
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa82fcbba561ef4107dce9188d2c451ee8c40afbf5ff67dbd4f98729f91fec40ce3b58f2e13fd04a9e2f91258757f283240680cbf7b609e2c3b7000168b2fff6
|
7
|
+
data.tar.gz: 848b2d731f440c3128c77e4cdddcb54ffc18cf1fdd423afc63b9300ccf074ad457b0064b70aab59d950ea242ba3e01b2ff33f8e02491859c24f23d5895f6f705
|
data/lib/html-proofer/check.rb
CHANGED
@@ -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
|
|
@@ -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
|
data/lib/html-proofer/runner.rb
CHANGED
@@ -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
|
|
data/lib/html-proofer/version.rb
CHANGED
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.
|
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-
|
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
|