html-proofer 1.3.1 → 1.3.2
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 +4 -4
- data/html-proofer.gemspec +1 -1
- data/lib/html/proofer.rb +2 -1
- data/lib/html/proofer/checks/links.rb +1 -1
- data/spec/html/proofer/fixtures/links/_site/folder.html/index.html +1 -0
- data/spec/html/proofer/fixtures/links/anchors_in_pre.html +1 -1
- data/spec/html/proofer/fixtures/links/hashReferringToSelf.html +44 -0
- data/spec/html/proofer/fixtures/links/relativeLinks.html +3 -3
- data/spec/html/proofer/fixtures/links/rootLink/folder/index.html +1 -0
- data/spec/html/proofer/fixtures/links/rootLink/index.html +1 -0
- data/spec/html/proofer/fixtures/links/{rootLink.html → rootLink/rootLink.html} +0 -0
- data/spec/html/proofer/links_spec.rb +13 -1
- data/spec/html/proofer_spec.rb +7 -0
- metadata +12 -6
- data/spec/html/proofer/fixtures/links/index.html +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d5b14b6178908b17570a31f33037c49877be42c
|
4
|
+
data.tar.gz: faafb22c69d987e04243461750f272b22636d890
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7434cb92b9bb07a453dc455505276f47866b8d4659427b101218a925fd2374321539f6ccda3ba81f93c1449e59c5a20410c439e5e8e08a4ad851a92dfcb055f
|
7
|
+
data.tar.gz: 7dca51e17a8033609e76988aa5d0a46d15e5790b6d11807b2db32d8bffb15f46baf5f784f9ac473a65c8c644bb718a0cc21a1eac55e3664778856a8c7d925abc
|
data/html-proofer.gemspec
CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
5
|
gem.name = "html-proofer"
|
6
|
-
gem.version = "1.3.
|
6
|
+
gem.version = "1.3.2"
|
7
7
|
gem.authors = ["Garen Torikian"]
|
8
8
|
gem.email = ["gjtorikian@gmail.com"]
|
9
9
|
gem.description = %q{Test your rendered HTML files to make sure they're accurate.}
|
data/lib/html/proofer.rb
CHANGED
@@ -160,7 +160,8 @@ module HTML
|
|
160
160
|
|
161
161
|
def files
|
162
162
|
if File.directory? @src
|
163
|
-
|
163
|
+
pattern = File.join @src, "**", "*#{@options[:ext]}"
|
164
|
+
Dir.glob(pattern).select { |fn| File.file? fn }
|
164
165
|
elsif File.extname(@src) == @options[:ext]
|
165
166
|
[@src]
|
166
167
|
else
|
@@ -36,7 +36,7 @@ class Links < ::HTML::Proofer::Checks::Check
|
|
36
36
|
# does the file even exist?
|
37
37
|
if link.remote?
|
38
38
|
add_to_external_urls link.href
|
39
|
-
|
39
|
+
elsif !link.internal?
|
40
40
|
self.add_issue "internally linking to #{link.href}, which does not exist" unless link.exists?
|
41
41
|
end
|
42
42
|
|
@@ -0,0 +1 @@
|
|
1
|
+
<html><head><title>Dummy</title></head></html>
|
@@ -0,0 +1,44 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="nl-NL" class="no-js" id="document">
|
3
|
+
<head prefix="og: http://ogp.me/ns# article: http://ogp.me/ns/article#">
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<title>Homepage</title>
|
6
|
+
</head>
|
7
|
+
<body>
|
8
|
+
|
9
|
+
<div id="skipLinks" class="skiplinks">
|
10
|
+
<a href="#mainMenu" class="skiplink">Naar hoofdnavigatiemenu</a>
|
11
|
+
<a href="#mainContent" class="skiplink">Naar hoofdinhoud</a>
|
12
|
+
</div>
|
13
|
+
|
14
|
+
<div class="site">
|
15
|
+
<header id="siteHeader" class="siteHeader" role="banner">
|
16
|
+
<h1 class="title">GeoDienstenCentrum</h1>
|
17
|
+
<p class="subtitle">Toegankelijke ruimtelijke informatievoorziening</p>
|
18
|
+
|
19
|
+
<nav id="sitenav" class="site-nav" role="navigation">
|
20
|
+
<ul>
|
21
|
+
<li id="mainMenu">
|
22
|
+
</li>
|
23
|
+
<li>
|
24
|
+
</li>
|
25
|
+
</ul>
|
26
|
+
</nav>
|
27
|
+
</header>
|
28
|
+
|
29
|
+
<main id="mainContent" tabindex="-1" role="main">
|
30
|
+
|
31
|
+
<p>Voor advies over en implementatie van toegankelijke ruimtelijke informatie met een
|
32
|
+
"privacy first" insteek, bij voorkeur op basis van open standaarden, open source software
|
33
|
+
en open data.<p>
|
34
|
+
|
35
|
+
</main>
|
36
|
+
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div class="site-footer">
|
40
|
+
<span class="rss">
|
41
|
+
</span>
|
42
|
+
</div>
|
43
|
+
</body>
|
44
|
+
</html>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<a href="/
|
2
|
-
<a href="
|
1
|
+
<a href="/anchors_in_pre.html">Relative to root</a>
|
2
|
+
<a href="anchors_in_pre.html">Relative to self</a>
|
3
3
|
<a href="folder/">Folder relative to self</a>
|
4
|
-
<a href="
|
4
|
+
<a href="anchors_in_pre.html#anchor">Anchor relative to self</a>
|
@@ -0,0 +1 @@
|
|
1
|
+
Here I am.
|
@@ -0,0 +1 @@
|
|
1
|
+
Here I am.
|
File without changes
|
@@ -72,7 +72,7 @@ describe "Links test" do
|
|
72
72
|
end
|
73
73
|
|
74
74
|
it 'properly checks links to root' do
|
75
|
-
rootLink = "#{FIXTURES_DIR}/links/rootLink.html"
|
75
|
+
rootLink = "#{FIXTURES_DIR}/links/rootLink/rootLink.html"
|
76
76
|
output = capture_stderr { HTML::Proofer.new(rootLink).run }
|
77
77
|
output.should == ""
|
78
78
|
end
|
@@ -222,4 +222,16 @@ describe "Links test" do
|
|
222
222
|
output = capture_stderr { HTML::Proofer.new(typhoeus_options_link, options).run }
|
223
223
|
output.should == ""
|
224
224
|
end
|
225
|
+
|
226
|
+
it "works if subdirectory ends with .html" do
|
227
|
+
with_subdirectory_html = "#{FIXTURES_DIR}/links/_site"
|
228
|
+
output = capture_stderr { HTML::Proofer.new(with_subdirectory_html).run }
|
229
|
+
output.should == ""
|
230
|
+
end
|
231
|
+
|
232
|
+
it "works for hash referring to itself" do
|
233
|
+
hashReferringToSelf = "#{FIXTURES_DIR}/links/hashReferringToSelf.html"
|
234
|
+
output = capture_stderr { HTML::Proofer.new(hashReferringToSelf).run }
|
235
|
+
output.should == ""
|
236
|
+
end
|
225
237
|
end
|
data/spec/html/proofer_spec.rb
CHANGED
@@ -9,4 +9,11 @@ describe HTML::Proofer do
|
|
9
9
|
proofer.failed_tests.should eq(["\e[34mspec/html/proofer/fixtures/links/brokenLinkInternal.html\e[0m: internally linking to ./notreal.html, which does not exist", "\e[34mspec/html/proofer/fixtures/links/brokenLinkInternal.html\e[0m: internally linking to ./missingImageAlt.html, which does not exist"])
|
10
10
|
end
|
11
11
|
end
|
12
|
+
describe "#files" do
|
13
|
+
it "works for directory that ends with .html" do
|
14
|
+
folder = "#{FIXTURES_DIR}/links/_site/folder.html"
|
15
|
+
proofer = HTML::Proofer.new folder
|
16
|
+
proofer.files.should == ["#{folder}/index.html"]
|
17
|
+
end
|
18
|
+
end
|
12
19
|
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: 1.3.
|
4
|
+
version: 1.3.2
|
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-08-
|
11
|
+
date: 2014-08-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mercenary
|
@@ -184,6 +184,7 @@ files:
|
|
184
184
|
- spec/html/proofer/fixtures/images/rootRelativeImages.html
|
185
185
|
- spec/html/proofer/fixtures/images/terribleImageName.html
|
186
186
|
- spec/html/proofer/fixtures/images/workingDataURIImage.html
|
187
|
+
- spec/html/proofer/fixtures/links/_site/folder.html/index.html
|
187
188
|
- spec/html/proofer/fixtures/links/anchors_in_pre.html
|
188
189
|
- spec/html/proofer/fixtures/links/blank_mailto_link.html
|
189
190
|
- spec/html/proofer/fixtures/links/blank_tel_link.html
|
@@ -203,12 +204,12 @@ files:
|
|
203
204
|
- spec/html/proofer/fixtures/links/folder/index.php
|
204
205
|
- spec/html/proofer/fixtures/links/folder/relativeImage.html
|
205
206
|
- spec/html/proofer/fixtures/links/gpl.png
|
207
|
+
- spec/html/proofer/fixtures/links/hashReferringToSelf.html
|
206
208
|
- spec/html/proofer/fixtures/links/head_link_href.html
|
207
209
|
- spec/html/proofer/fixtures/links/head_link_href_absent.html
|
208
210
|
- spec/html/proofer/fixtures/links/head_link_href_empty.html
|
209
211
|
- spec/html/proofer/fixtures/links/ignorableLinks.html
|
210
212
|
- spec/html/proofer/fixtures/links/ignorableLinksViaOptions.html
|
211
|
-
- spec/html/proofer/fixtures/links/index.html
|
212
213
|
- spec/html/proofer/fixtures/links/javascript_link.html
|
213
214
|
- spec/html/proofer/fixtures/links/linkToFolder.html
|
214
215
|
- spec/html/proofer/fixtures/links/linkTranslatedViaHrefSwap.html
|
@@ -224,7 +225,9 @@ files:
|
|
224
225
|
- spec/html/proofer/fixtures/links/multipleProblems.html
|
225
226
|
- spec/html/proofer/fixtures/links/notarealhash.html
|
226
227
|
- spec/html/proofer/fixtures/links/relativeLinks.html
|
227
|
-
- spec/html/proofer/fixtures/links/rootLink.html
|
228
|
+
- spec/html/proofer/fixtures/links/rootLink/folder/index.html
|
229
|
+
- spec/html/proofer/fixtures/links/rootLink/index.html
|
230
|
+
- spec/html/proofer/fixtures/links/rootLink/rootLink.html
|
228
231
|
- spec/html/proofer/fixtures/links/tel_link.html
|
229
232
|
- spec/html/proofer/fixtures/resources/Screen Shot 2012-08-09 at 7.51.18 AM.png
|
230
233
|
- spec/html/proofer/fixtures/resources/books/assets/getting-good-with-git.jpg
|
@@ -294,6 +297,7 @@ test_files:
|
|
294
297
|
- spec/html/proofer/fixtures/images/rootRelativeImages.html
|
295
298
|
- spec/html/proofer/fixtures/images/terribleImageName.html
|
296
299
|
- spec/html/proofer/fixtures/images/workingDataURIImage.html
|
300
|
+
- spec/html/proofer/fixtures/links/_site/folder.html/index.html
|
297
301
|
- spec/html/proofer/fixtures/links/anchors_in_pre.html
|
298
302
|
- spec/html/proofer/fixtures/links/blank_mailto_link.html
|
299
303
|
- spec/html/proofer/fixtures/links/blank_tel_link.html
|
@@ -313,12 +317,12 @@ test_files:
|
|
313
317
|
- spec/html/proofer/fixtures/links/folder/index.php
|
314
318
|
- spec/html/proofer/fixtures/links/folder/relativeImage.html
|
315
319
|
- spec/html/proofer/fixtures/links/gpl.png
|
320
|
+
- spec/html/proofer/fixtures/links/hashReferringToSelf.html
|
316
321
|
- spec/html/proofer/fixtures/links/head_link_href.html
|
317
322
|
- spec/html/proofer/fixtures/links/head_link_href_absent.html
|
318
323
|
- spec/html/proofer/fixtures/links/head_link_href_empty.html
|
319
324
|
- spec/html/proofer/fixtures/links/ignorableLinks.html
|
320
325
|
- spec/html/proofer/fixtures/links/ignorableLinksViaOptions.html
|
321
|
-
- spec/html/proofer/fixtures/links/index.html
|
322
326
|
- spec/html/proofer/fixtures/links/javascript_link.html
|
323
327
|
- spec/html/proofer/fixtures/links/linkToFolder.html
|
324
328
|
- spec/html/proofer/fixtures/links/linkTranslatedViaHrefSwap.html
|
@@ -334,7 +338,9 @@ test_files:
|
|
334
338
|
- spec/html/proofer/fixtures/links/multipleProblems.html
|
335
339
|
- spec/html/proofer/fixtures/links/notarealhash.html
|
336
340
|
- spec/html/proofer/fixtures/links/relativeLinks.html
|
337
|
-
- spec/html/proofer/fixtures/links/rootLink.html
|
341
|
+
- spec/html/proofer/fixtures/links/rootLink/folder/index.html
|
342
|
+
- spec/html/proofer/fixtures/links/rootLink/index.html
|
343
|
+
- spec/html/proofer/fixtures/links/rootLink/rootLink.html
|
338
344
|
- spec/html/proofer/fixtures/links/tel_link.html
|
339
345
|
- spec/html/proofer/fixtures/resources/Screen Shot 2012-08-09 at 7.51.18 AM.png
|
340
346
|
- spec/html/proofer/fixtures/resources/books/assets/getting-good-with-git.jpg
|
@@ -1 +0,0 @@
|
|
1
|
-
<h1 id="anchor">root.</a>
|