html-proofer 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/html/proofer.rb +1 -1
- data/lib/html/proofer/check.rb +8 -3
- data/lib/html/proofer/version.rb +1 -1
- data/spec/html/proofer/images_spec.rb +1 -1
- data/spec/html/proofer/links_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e33429fb9fa389bbbb8468fdd2c0d74b8077dac1
|
4
|
+
data.tar.gz: d6177bdf7d4bcb8c277145bcf7e475b67d08f4d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb236e1f2aa2bd658d1a5ce002dc9a0f3ddab6e2d345dc40c9741421c2c5234b7e8d1a246455cc5908017fe4548c55a3aec2e0851c4880a48a1183f1a9fc3aee
|
7
|
+
data.tar.gz: 705dd934e90654fb1e77c76e0c99e0c9c5757720b92071d28d8c206cda6961486b83efa1a27bf4af7ecb02e904243efc688e2c9bc1b0152691bd5da6e7d09caa
|
data/Gemfile.lock
CHANGED
data/lib/html/proofer.rb
CHANGED
data/lib/html/proofer/check.rb
CHANGED
@@ -44,10 +44,15 @@ class HTML::Proofer::Checks
|
|
44
44
|
self.add_issue(issue_text + " got a time out")
|
45
45
|
elsif response.code == 0
|
46
46
|
# Could not get an http response, something's wrong.
|
47
|
-
self.add_issue(issue_text + " #{response}")
|
47
|
+
self.add_issue(issue_text + ". #{response.return_message}!")
|
48
48
|
else
|
49
|
-
|
50
|
-
|
49
|
+
if %w(420 503).include?(response.code.to_s)
|
50
|
+
response = Typhoeus.get(href, {:followlocation => true})
|
51
|
+
self.add_issue("#{issue_text} HTTP request failed: #{response.code.to_s}") unless response.success?
|
52
|
+
else
|
53
|
+
# Received a non-successful http response.
|
54
|
+
self.add_issue("#{issue_text} HTTP request failed: #{response.code.to_s}")
|
55
|
+
end
|
51
56
|
end
|
52
57
|
end
|
53
58
|
hydra.queue(request)
|
data/lib/html/proofer/version.rb
CHANGED
@@ -28,7 +28,7 @@ describe "Image tests" do
|
|
28
28
|
@imageCheck.run
|
29
29
|
@imageCheck.hydra.run
|
30
30
|
@imageCheck.issues[0].sub!(/ #<Typhoeus::Response:[\w]+>/, "")
|
31
|
-
@imageCheck.issues[0].should eq("spec/html/proofer/fixtures/missingImageExternal.html".blue + ": external image http://www.whatthehell does not exist")
|
31
|
+
@imageCheck.issues[0].should eq("spec/html/proofer/fixtures/missingImageExternal.html".blue + ": external image http://www.whatthehell does not exist. Couldn't resolve host name!")
|
32
32
|
end
|
33
33
|
|
34
34
|
it "fails for missing internal images" do
|
@@ -22,7 +22,7 @@ describe "Links tests" do
|
|
22
22
|
@linkCheck.run
|
23
23
|
@linkCheck.hydra.run
|
24
24
|
@linkCheck.issues[0].sub!(/ #<Typhoeus::Response:[\w]+>/, "")
|
25
|
-
@linkCheck.issues[0].should eq("spec/html/proofer/fixtures/brokenLinkExternal.html".blue + ": externally linking to http://www.asdo3IRJ395295jsingrkrg4.com, which does not exist")
|
25
|
+
@linkCheck.issues[0].should eq("spec/html/proofer/fixtures/brokenLinkExternal.html".blue + ": externally linking to http://www.asdo3IRJ395295jsingrkrg4.com, which does not exist. Couldn't resolve host name!")
|
26
26
|
end
|
27
27
|
|
28
28
|
it "fails for broken internal links" do
|
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: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Garen Torikian
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-10-
|
11
|
+
date: 2013-10-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|