bad_link_finder 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bad_link_finder/link.rb +5 -0
- data/lib/bad_link_finder/version.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: eb79f23c7fabe10bbd9654a4eadfffde34ed2cac
|
4
|
+
data.tar.gz: bf8da7c36a356b4bf2281d78a872a897afc2d94a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97e222a53897c800715cec1c16c322213c9c563cde70aa483abda47aaf99e1ae8c8eefa2659969fc4260f9c8cc9999affdac0d2ff89ad18ff5f0de430653b664
|
7
|
+
data.tar.gz: fb7db07dbf3b04e1804c9e3ea555796fa47734dc2e1c2613bab2d7df3a338c9221dae8ce059a253e1f907217a18fdc5f7fade1e15f6736252b0dd01b07c9b10b
|
data/lib/bad_link_finder/link.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'mechanize'
|
2
|
+
require 'openssl'
|
2
3
|
|
3
4
|
module BadLinkFinder
|
4
5
|
class Link
|
@@ -33,6 +34,8 @@ module BadLinkFinder
|
|
33
34
|
Errno::ECONNRESET, Errno::ETIMEDOUT, EOFError, Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError,
|
34
35
|
Net::ProtocolError, OpenSSL::SSL::SSLError, SocketError => exception # Thanks Net::HTTP
|
35
36
|
record_error("The server failed to serve this page properly", exception)
|
37
|
+
rescue Exception => exception
|
38
|
+
record_error("Some other exception happened", exception)
|
36
39
|
end
|
37
40
|
|
38
41
|
def valid?
|
@@ -49,6 +52,8 @@ module BadLinkFinder
|
|
49
52
|
browser.user_agent = 'GOV.UK link checker'
|
50
53
|
browser.keep_alive = false
|
51
54
|
browser.history.max_size = 0
|
55
|
+
browser.agent.http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
56
|
+
browser.agent.open_timeout = 15
|
52
57
|
|
53
58
|
if @head_unsupported
|
54
59
|
browser.get(@url)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bad_link_finder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elliot Crosby-McCullough
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mechanize
|