html-proofer 3.0.4 → 3.0.5

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: 19ea6449530b524fb286faac105fe0707c8566c1
4
- data.tar.gz: 59d6d1f70677e4cfdfe6713af5a204f21f95d8b5
3
+ metadata.gz: af419279efbdd381866a4bd46f230e7d5d2c4fdb
4
+ data.tar.gz: 7927600634fc32d291327b387738c66f16685362
5
5
  SHA512:
6
- metadata.gz: acdbc3b8f303104a037c7cf6b897cafc49706e4bc3aa70d1bf9d17fab58a7ee7b7a0622680d0e7fcc758973c61c576bfbcd4fc94f79d12ecc8092eca36d473ec
7
- data.tar.gz: bbcd47c3576798d427a8f72dc417e47ceb3620b51ab2b5fee1ce8669569ee190338e2cb1930be85d2ceb9901fc8b1ac149ab49e3fda6a557ce7bb78f48bf0d1a
6
+ metadata.gz: 966bc174bbaf591880bea6e905a0c51c79f5d025f7956ac9e133dac08740ac5e2206bfa915d7574aa67bf9b7b6952800335abaf883b1c9d12d83c4cf1f49ecf2
7
+ data.tar.gz: 09c8d6ef8d75644b0e4e5383a67886cd38df6f90b22ecfbbf502e1a4b942e353cc5fb09c918cb67937dd079b46812f9b01a0ac65667bb5cb6e572fc1022dfdfd
@@ -71,6 +71,8 @@ Mercenary.program(:htmlproofer) do |p|
71
71
 
72
72
  options[:cache] = {}
73
73
  options[:cache][:timeframe] = opts['timeframe'] unless opts['timeframe'].nil?
74
+
75
+ options[:http_status_ignore] = Array(options[:http_status_ignore]).map(&:to_i)
74
76
 
75
77
  paths = path.split(',')
76
78
  if opts['as_links']
@@ -28,7 +28,7 @@ module HTMLProofer
28
28
  end
29
29
 
30
30
  def url
31
- url = @src || @srcset || @href || ''
31
+ url = (@src || @srcset || @href || '').gsub("\u200b", '')
32
32
  return url if @check.options[:url_swap].empty?
33
33
  swap(url, @check.options[:url_swap])
34
34
  end
@@ -39,7 +39,7 @@ module HTMLProofer
39
39
 
40
40
  def parts
41
41
  @parts ||= Addressable::URI.parse url
42
- rescue URI::Error, Addressable::URI::InvalidURIError
42
+ rescue URI::Error, Addressable::URI::InvalidURIError => e
43
43
  @parts = nil
44
44
  end
45
45
 
@@ -150,7 +150,7 @@ module HTMLProofer
150
150
  elsif response.timed_out?
151
151
  handle_timeout(href, filenames, response_code)
152
152
  elsif response_code == 0
153
- handle_failure(href, filenames, response_code)
153
+ handle_failure(href, filenames, response_code, response.return_message)
154
154
  elsif method == :head
155
155
  queue_request(:get, href, filenames)
156
156
  else
@@ -192,8 +192,11 @@ module HTMLProofer
192
192
  add_external_issue(filenames, msg, response_code)
193
193
  end
194
194
 
195
- def handle_failure(href, filenames, response_code)
196
- msg = "External link #{href} failed: response code #{response_code} means something's wrong"
195
+ def handle_failure(href, filenames, response_code, return_message)
196
+ msg = "External link #{href} failed: response code #{response_code} means something's wrong.
197
+ It's possible libcurl couldn't connect to the server or perhaps the request timed out.
198
+ Sometimes, making too many requests at once also breaks things.
199
+ Either way, the return message (if any) from the server is: #{return_message}"
197
200
  @cache.add(href, filenames, 0, msg)
198
201
  return if @options[:only_4xx]
199
202
  add_external_issue(filenames, msg, response_code)
@@ -1,3 +1,3 @@
1
1
  module HTMLProofer
2
- VERSION = '3.0.4'
2
+ VERSION = '3.0.5'
3
3
  end
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.0.4
4
+ version: 3.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen Torikian
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-10 00:00:00.000000000 Z
11
+ date: 2016-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mercenary