html-proofer 0.2.0 → 0.2.1

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
  SHA1:
3
- metadata.gz: 185d85305a997ab32e3329e54ed9b83a95569527
4
- data.tar.gz: 2bb28f53766e220fda2486332f520d76cd6bb771
3
+ metadata.gz: e33429fb9fa389bbbb8468fdd2c0d74b8077dac1
4
+ data.tar.gz: d6177bdf7d4bcb8c277145bcf7e475b67d08f4d9
5
5
  SHA512:
6
- metadata.gz: e1c0b42b8e196a4ac5d1a2e3cd074d2a768cd846711a08d60506c2c36631cd22757f410e2500bc4c944420a6dd261dedcce8381feb7b5495214b9292392f445a
7
- data.tar.gz: e9d01ee50d2c57ac27ed68ead827e4df329d2d0ef61644f27bacf5cd128de571f9e9af1f74658b9f0bbde2a83895df9735f201d369fbd706afae0b705af59b2e
6
+ metadata.gz: cb236e1f2aa2bd658d1a5ce002dc9a0f3ddab6e2d345dc40c9741421c2c5234b7e8d1a246455cc5908017fe4548c55a3aec2e0851c4880a48a1183f1a9fc3aee
7
+ data.tar.gz: 705dd934e90654fb1e77c76e0c99e0c9c5757720b92071d28d8c206cda6961486b83efa1a27bf4af7ecb02e904243efc688e2c9bc1b0152691bd5da6e7d09caa
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- html-proofer (0.1.1)
4
+ html-proofer (0.2.0)
5
5
  colored (~> 1.2)
6
6
  nokogiri (= 1.6.0)
7
7
  typhoeus (~> 0.6.3)
data/lib/html/proofer.rb CHANGED
@@ -27,7 +27,7 @@ module HTML
27
27
  end
28
28
 
29
29
  if @failedTests.empty?
30
- puts "Tests executed sucesfully.".green
30
+ puts "Tests executed successfully.".green
31
31
  exit 0
32
32
  else
33
33
  # make the hash default to 0 so that += will work correctly
@@ -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
- # Received a non-successful http response.
50
- self.add_issue(issue_text + " HTTP request failed: " + response.code.to_s) unless response.code.to_s == "420"
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)
@@ -1,5 +1,5 @@
1
1
  module HTML
2
2
  class Proofer
3
- VERSION = "0.2.0"
3
+ VERSION = "0.2.1"
4
4
  end
5
5
  end
@@ -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.0
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-23 00:00:00.000000000 Z
11
+ date: 2013-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri