html-proofer 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5e5909766c9238ff49f259614dbd5bfff830a920
4
- data.tar.gz: 3a45a58edf7f65fc01aab97c7a0956832c0a34a0
3
+ metadata.gz: 251947156251aad2dfb34f8f05b24fe387c34b79
4
+ data.tar.gz: 0b1ef3155efa7036f09db41e0cd4689002cdf318
5
5
  SHA512:
6
- metadata.gz: c00c823d8dc440505d322a25837004746fdc82a0ddc7436ef9124e97482e6c47f3166a2b00df326e1c6b4169379d6baf86b794e15e258bb083e21e581d977de9
7
- data.tar.gz: 4fa2d40727d56fc2db28d33e65666f5e91a48d1270736d023338eb98e6fc68d8d753dc72dadfa8aa13eadabc9ba3435c42169027ca5a49687a2d582b9386f725
6
+ metadata.gz: 9de89df3791ddb7d945fe5e6624fb18db97407364ab070dd5aa0598d9d414baf276f578f2e7aec90db432596da79f4005ff1b9267093921d02c2827cd0ce88fa
7
+ data.tar.gz: 49e32043dbe5a4fd60f46da560c47185cb7319f769cde383045df9d91fcfd205a6c56266f59274d18f6c889405a5da5b0371283371a45d5129853924c81c42b2
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- html-proofer (0.2.2)
4
+ html-proofer (0.2.3)
5
5
  colored (~> 1.2)
6
6
  nokogiri (= 1.6.0)
7
7
  typhoeus (~> 0.6.3)
@@ -19,7 +19,7 @@ class HTML::Proofer::Checks
19
19
  @options = opts
20
20
  @issues = []
21
21
 
22
- @hydra = Typhoeus::Hydra.new(:max_concurrency => 15)
22
+ @hydra = Typhoeus::Hydra.hydra
23
23
  @additional_href_ignores = @options[:href_ignore] || []
24
24
  end
25
25
 
@@ -47,7 +47,15 @@ class HTML::Proofer::Checks
47
47
  self.add_issue(issue_text + ". #{response.return_message}!")
48
48
  else
49
49
  response_code = response.code.to_s
50
- self.add_issue("#{issue_text} HTTP request failed: #{response_code}")
50
+ if %w(420 503).include?(response_code)
51
+ # 420s usually come from rate limiting; let's ignore the query and try just the path
52
+ uri = URI(href)
53
+ response = Typhoeus.get(uri.scheme + "://" + uri.host + uri.path, {:followlocation => true})
54
+ self.add_issue("#{issue_text} Originally, this was a #{response_code}. Now, the HTTP request failed again: #{response.code.to_s}") unless response.success?
55
+ else
56
+ # Received a non-successful http response.
57
+ self.add_issue("#{issue_text} HTTP request failed: #{response_code}")
58
+ end
51
59
  end
52
60
  end
53
61
  hydra.queue(request)
@@ -1,5 +1,5 @@
1
1
  module HTML
2
2
  class Proofer
3
- VERSION = "0.2.2"
3
+ VERSION = "0.2.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: html-proofer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen Torikian