html-proofer 3.7.6 → 3.8.0
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/cache.rb +1 -7
- data/lib/html-proofer/url_validator.rb +4 -4
- data/lib/html-proofer/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fbaac895cc16c29554e70a2640f654087f7f6bfa
|
4
|
+
data.tar.gz: d0705afd3249cc486bd6de557edb479ea976d15d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b429b5ab045115c0d8a1ac7e527b7240be21650ddf8dcc09f71c3669345a5a0b4e6d43be2174ae8dfc882b3fa33760561e5d8b4e9c93fdab4d8a0d03709c97a8
|
7
|
+
data.tar.gz: 40ccce6b3054b72099e6dfd4db6219dca204dae3fcd8f0301e27870d92392289493aa99f62e9279357464bcd1434c9b18d7797fefcdc4ffeb090e0382ddf5986
|
data/lib/html-proofer/cache.rb
CHANGED
@@ -128,12 +128,6 @@ module HTMLProofer
|
|
128
128
|
urls_to_check
|
129
129
|
end
|
130
130
|
|
131
|
-
# FIXME: there seems to be some discrepenacy where Typhoeus occasionally adds
|
132
|
-
# a trailing slash to URL strings, which causes issues with the cache
|
133
|
-
def slashless_url(url)
|
134
|
-
url.chomp('/')
|
135
|
-
end
|
136
|
-
|
137
131
|
# FIXME: it seems that Typhoeus actually acts on escaped URLs,
|
138
132
|
# but there's no way to get at that information, and the cache
|
139
133
|
# stores unescaped URLs. Because of this, some links, such as
|
@@ -144,7 +138,7 @@ module HTMLProofer
|
|
144
138
|
end
|
145
139
|
|
146
140
|
def clean_url(url)
|
147
|
-
|
141
|
+
unescape_url(url)
|
148
142
|
end
|
149
143
|
|
150
144
|
def setup_cache!(options)
|
@@ -163,7 +163,7 @@ module HTMLProofer
|
|
163
163
|
else
|
164
164
|
return if @options[:only_4xx] && !response_code.between?(400, 499)
|
165
165
|
# Received a non-successful http response.
|
166
|
-
msg = "External link #{href
|
166
|
+
msg = "External link #{href} failed: #{response_code} #{response.return_message}"
|
167
167
|
add_external_issue(filenames, msg, response_code)
|
168
168
|
@cache.add(href, filenames, response_code, msg)
|
169
169
|
end
|
@@ -186,21 +186,21 @@ module HTMLProofer
|
|
186
186
|
|
187
187
|
return unless body_doc.xpath(xpath).empty?
|
188
188
|
|
189
|
-
msg = "External link #{href
|
189
|
+
msg = "External link #{href} failed: #{effective_url} exists, but the hash '#{hash}' does not"
|
190
190
|
add_external_issue(filenames, msg, response.code)
|
191
191
|
@cache.add(href, filenames, response.code, msg)
|
192
192
|
true
|
193
193
|
end
|
194
194
|
|
195
195
|
def handle_timeout(href, filenames, response_code)
|
196
|
-
msg = "External link #{href
|
196
|
+
msg = "External link #{href} failed: got a time out (response code #{response_code})"
|
197
197
|
@cache.add(href, filenames, 0, msg)
|
198
198
|
return if @options[:only_4xx]
|
199
199
|
add_external_issue(filenames, msg, response_code)
|
200
200
|
end
|
201
201
|
|
202
202
|
def handle_failure(href, filenames, response_code, return_message)
|
203
|
-
msg = "External link #{href
|
203
|
+
msg = "External link #{href} failed: response code #{response_code} means something's wrong.
|
204
204
|
It's possible libcurl couldn't connect to the server or perhaps the request timed out.
|
205
205
|
Sometimes, making too many requests at once also breaks things.
|
206
206
|
Either way, the return message (if any) from the server is: #{return_message}"
|
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.
|
4
|
+
version: 3.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Garen Torikian
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mercenary
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '1.3'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '1.3'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: yell
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|