html-proofer 0.6.0 → 0.6.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a64f7619a12b5530d6591a5136c408daa4dcf159
|
4
|
+
data.tar.gz: a7e55e707f23576b8dbaea564dceb2e0bdf5d214
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37bd1c5bd65c46f6719c450a9016846f3a29d6e4fa94cc0a5fa67e95813ea0081381b73baf64b462e04c9b4bdd505ce3b0cb895a40621c5ea34a4efdf986a29a
|
7
|
+
data.tar.gz: 5f623b2e311b3045c5b55354991a8e90d9f70f986110b9fe70d18f65a9de8fb8230f762bd5fe4b6eef3f065f1c51e9f0fa014d8ab6c8f30e666bacecc44f2311
|
@@ -17,13 +17,19 @@ class Links < ::HTML::Proofer::Checks::Check
|
|
17
17
|
def run
|
18
18
|
@html.css('a').each do |l|
|
19
19
|
link = Link.new l, "link", self
|
20
|
-
|
20
|
+
next if link.ignore?
|
21
21
|
|
22
22
|
# is there even a href?
|
23
|
-
|
23
|
+
if link.missing_href?
|
24
|
+
self.add_issue("link has no href attribute")
|
25
|
+
next
|
26
|
+
end
|
24
27
|
|
25
28
|
# is it even a valid URL?
|
26
|
-
|
29
|
+
unless link.valid?
|
30
|
+
self.add_issue "#{link.href} is an invalid URL"
|
31
|
+
next
|
32
|
+
end
|
27
33
|
|
28
34
|
# does the file even exist?
|
29
35
|
if link.remote?
|
data/lib/html/proofer/version.rb
CHANGED
@@ -91,4 +91,10 @@ describe "Links tests" do
|
|
91
91
|
output = capture_stderr { HTML::Proofer.new(translatedLink, {:href_swap => { /\A\/articles\/([\w-]+)/ => "\\1.html" }}).run }
|
92
92
|
output.should == ""
|
93
93
|
end
|
94
|
+
|
95
|
+
it 'finds a mix of broken and unbroken links' do
|
96
|
+
multipleProblems = "#{FIXTURES_DIR}/multipleProblems.html"
|
97
|
+
output = capture_stderr { HTML::Proofer.new(multipleProblems).run }
|
98
|
+
output.should match /linking to internal hash #anadaasdadsadschor that does not exist/
|
99
|
+
end
|
94
100
|
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: 0.6.
|
4
|
+
version: 0.6.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: 2014-
|
11
|
+
date: 2014-03-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mercenary
|
@@ -158,6 +158,7 @@ files:
|
|
158
158
|
- spec/html/proofer/fixtures/missingImageInternal.html
|
159
159
|
- spec/html/proofer/fixtures/missingImageSrc.html
|
160
160
|
- spec/html/proofer/fixtures/missingLinkHref.html
|
161
|
+
- spec/html/proofer/fixtures/multipleProblems.html
|
161
162
|
- spec/html/proofer/fixtures/notarealhash.html
|
162
163
|
- spec/html/proofer/fixtures/relativeLinks.html
|
163
164
|
- spec/html/proofer/fixtures/resources/books/assets/getting-good-with-git.jpg
|
@@ -227,6 +228,7 @@ test_files:
|
|
227
228
|
- spec/html/proofer/fixtures/missingImageInternal.html
|
228
229
|
- spec/html/proofer/fixtures/missingImageSrc.html
|
229
230
|
- spec/html/proofer/fixtures/missingLinkHref.html
|
231
|
+
- spec/html/proofer/fixtures/multipleProblems.html
|
230
232
|
- spec/html/proofer/fixtures/notarealhash.html
|
231
233
|
- spec/html/proofer/fixtures/relativeLinks.html
|
232
234
|
- spec/html/proofer/fixtures/resources/books/assets/getting-good-with-git.jpg
|
@@ -241,4 +243,3 @@ test_files:
|
|
241
243
|
- spec/html/proofer/links_spec.rb
|
242
244
|
- spec/html/proofer/version_spec.rb
|
243
245
|
- spec/spec_helper.rb
|
244
|
-
has_rdoc:
|