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: 033e57eb82d6d3f2504faf1dbc56545692b4f09b
4
- data.tar.gz: 39d300ef45a4a96e202640017da0cb274a35b45b
3
+ metadata.gz: a64f7619a12b5530d6591a5136c408daa4dcf159
4
+ data.tar.gz: a7e55e707f23576b8dbaea564dceb2e0bdf5d214
5
5
  SHA512:
6
- metadata.gz: 9a11d8ce720aed31d0faa6e76b2376d5e7985098a17552b80d7828768713983055de269f939e7110337dfbff3d323229825f557d2d1890fc56423217fb89303a
7
- data.tar.gz: 46e06af17e6c1e9da744b5f208189b4848ab805df2b1100adc54b12b45fab7dc87c9c2169cf2b90eb5d169a9548844dad49229a1f0808f81b7c4ca29b4e41f6b
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
- return if link.ignore?
20
+ next if link.ignore?
21
21
 
22
22
  # is there even a href?
23
- return self.add_issue("link has no href attribute") if link.missing_href?
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
- return self.add_issue "#{link.href} is an invalid URL" unless link.valid?
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?
@@ -1,5 +1,5 @@
1
1
  module HTML
2
2
  class Proofer
3
- VERSION = "0.6.0"
3
+ VERSION = "0.6.1"
4
4
  end
5
5
  end
@@ -0,0 +1,11 @@
1
+ <html>
2
+
3
+ <body>
4
+
5
+ <a href="http://www.asdo3IRJ395295jsingrkrg4.com" data-proofer-ignore="true">broken link!</a>
6
+
7
+ <a href="#anadaasdadsadschor">Anchor relative to nothing</a>
8
+
9
+ </body>
10
+
11
+ </html>
@@ -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.0
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-02-11 00:00:00.000000000 Z
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: