bad_link_finder 0.3.0 → 0.3.1
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 +1 -1
- data/lib/bad_link_finder/version.rb +1 -1
- data/test/unit/link_test.rb +8 -0
- metadata +25 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8043b2bdbf6388c865a5df0b2df8c3c11d4bfd19
|
4
|
+
data.tar.gz: bf52e9188c38476b68cf198e92534ea77a2da19b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67b3140911740a7775053a45f879a065b331422edf99c4820990844967da2efaededcca5873fd8521cdd4b8a8e18df6b007a10e49608652a85179fd7ac914b20
|
7
|
+
data.tar.gz: a9c53982fb8e726f1df1a248043d58edf122fece52f16e35db8392a8a1b4e13ecee9d4d9e8ea9a819272456115323636bab4f0bb49a405c22529a986dba41a95
|
data/lib/bad_link_finder/link.rb
CHANGED
@@ -15,7 +15,7 @@ module BadLinkFinder
|
|
15
15
|
rescue URI::InvalidURIError => exception
|
16
16
|
record_error("This link is in a bad format", exception)
|
17
17
|
rescue Mechanize::ResponseCodeError => exception
|
18
|
-
if exception.response_code.to_i
|
18
|
+
if [405, 500].include?(exception.response_code.to_i) && !@head_unsupported
|
19
19
|
@head_unsupported = true
|
20
20
|
retry
|
21
21
|
else
|
data/test/unit/link_test.rb
CHANGED
@@ -63,6 +63,14 @@ describe BadLinkFinder::Link do
|
|
63
63
|
|
64
64
|
assert link.valid?
|
65
65
|
end
|
66
|
+
|
67
|
+
it "retries 500s as GET requests" do
|
68
|
+
stub_request(:head, "http://www.example.com/an-example-path").to_return(status: 500)
|
69
|
+
stub_request(:get, "http://www.example.com/an-example-path").to_return(status: 200)
|
70
|
+
link = build_link('/an-example-path')
|
71
|
+
|
72
|
+
assert link.valid?
|
73
|
+
end
|
66
74
|
end
|
67
75
|
|
68
76
|
def stub_url(url, status)
|
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.1
|
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-
|
11
|
+
date: 2014-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mechanize
|
@@ -117,30 +117,30 @@ executables:
|
|
117
117
|
extensions: []
|
118
118
|
extra_rdoc_files: []
|
119
119
|
files:
|
120
|
-
- LICENCE.txt
|
121
|
-
- README.md
|
122
120
|
- bin/bad_link_finder
|
123
121
|
- lib/bad_link_finder.rb
|
122
|
+
- lib/bad_link_finder/site.rb
|
123
|
+
- lib/bad_link_finder/result_cache.rb
|
124
124
|
- lib/bad_link_finder/csv_builder.rb
|
125
|
-
- lib/bad_link_finder/
|
125
|
+
- lib/bad_link_finder/site_checker.rb
|
126
126
|
- lib/bad_link_finder/page.rb
|
127
127
|
- lib/bad_link_finder/page_checker.rb
|
128
|
-
- lib/bad_link_finder/result_cache.rb
|
129
|
-
- lib/bad_link_finder/site.rb
|
130
|
-
- lib/bad_link_finder/site_checker.rb
|
131
128
|
- lib/bad_link_finder/version.rb
|
132
|
-
-
|
133
|
-
-
|
134
|
-
-
|
129
|
+
- lib/bad_link_finder/link.rb
|
130
|
+
- README.md
|
131
|
+
- LICENCE.txt
|
135
132
|
- test/integration/bad_link_finder_test.rb
|
136
|
-
- test/
|
137
|
-
- test/
|
133
|
+
- test/unit/page_test.rb
|
134
|
+
- test/unit/site_test.rb
|
138
135
|
- test/unit/csv_builder_test.rb
|
136
|
+
- test/unit/result_cache_test.rb
|
139
137
|
- test/unit/link_test.rb
|
140
138
|
- test/unit/page_checker_test.rb
|
141
|
-
- test/
|
142
|
-
- test/
|
143
|
-
- test/
|
139
|
+
- test/support/matchers.rb
|
140
|
+
- test/fixtures/www.example.com/example/index.html
|
141
|
+
- test/fixtures/www.example.com/example/relative-example.html
|
142
|
+
- test/fixtures/www.example.com/index.html
|
143
|
+
- test/test_helper.rb
|
144
144
|
homepage: http://github.com/alphagov/bad_link_finder
|
145
145
|
licenses:
|
146
146
|
- MIT
|
@@ -161,20 +161,20 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
161
161
|
version: '0'
|
162
162
|
requirements: []
|
163
163
|
rubyforge_project:
|
164
|
-
rubygems_version: 2.
|
164
|
+
rubygems_version: 2.1.11
|
165
165
|
signing_key:
|
166
166
|
specification_version: 4
|
167
167
|
summary: Tests links in static site mirrors
|
168
168
|
test_files:
|
169
|
-
- test/fixtures/www.example.com/example/index.html
|
170
|
-
- test/fixtures/www.example.com/example/relative-example.html
|
171
|
-
- test/fixtures/www.example.com/index.html
|
172
169
|
- test/integration/bad_link_finder_test.rb
|
173
|
-
- test/
|
174
|
-
- test/
|
170
|
+
- test/unit/page_test.rb
|
171
|
+
- test/unit/site_test.rb
|
175
172
|
- test/unit/csv_builder_test.rb
|
173
|
+
- test/unit/result_cache_test.rb
|
176
174
|
- test/unit/link_test.rb
|
177
175
|
- test/unit/page_checker_test.rb
|
178
|
-
- test/
|
179
|
-
- test/
|
180
|
-
- test/
|
176
|
+
- test/support/matchers.rb
|
177
|
+
- test/fixtures/www.example.com/example/index.html
|
178
|
+
- test/fixtures/www.example.com/example/relative-example.html
|
179
|
+
- test/fixtures/www.example.com/index.html
|
180
|
+
- test/test_helper.rb
|