html-proofer 2.0.5 → 2.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/html/proofer.rb +2 -2
- data/lib/html/proofer/check_runner.rb +7 -3
- data/lib/html/proofer/checkable.rb +2 -3
- data/lib/html/proofer/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: 38bdb56d1187e2c55f121acd5cc188c19f9cf6b4
|
4
|
+
data.tar.gz: 78f2f907207b977c5ddf14d832a090dcc128d80d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9487623300788e08378e03ad6b1b73dd9d8a39b2258f244284e44357d8c49989d66a91c95fc270412c862b95fa780ad8a2d1abd363776f2cf8f61c5ea91e1c0
|
7
|
+
data.tar.gz: f8ccdae6420f40e23ac8695adeb9b17adaf0bb4896bd4aa029cb5dec648b91c980eabe1ac67903c7b000343d4ef9fafa9a75d315b4529139fe2a286a9950fe0f
|
data/README.md
CHANGED
@@ -227,7 +227,7 @@ class MailToOctocat < ::HTML::Proofer::CheckRunner
|
|
227
227
|
|
228
228
|
def run
|
229
229
|
@html.css('a').each do |l|
|
230
|
-
link = OctocatLinkCheck.new l,
|
230
|
+
link = OctocatLinkCheck.new l, self
|
231
231
|
|
232
232
|
if link.mailto? && link.octocat?
|
233
233
|
return add_issue("Don't email the Octocat directly!")
|
data/lib/html/proofer.rb
CHANGED
@@ -21,7 +21,7 @@ module HTML
|
|
21
21
|
class Proofer
|
22
22
|
include Utils
|
23
23
|
|
24
|
-
attr_reader :options, :typhoeus_opts, :parallel_opts
|
24
|
+
attr_reader :options, :typhoeus_opts, :hydra_opts, :parallel_opts
|
25
25
|
|
26
26
|
def initialize(src, opts = {})
|
27
27
|
@src = src
|
@@ -117,7 +117,7 @@ module HTML
|
|
117
117
|
|
118
118
|
checks.each do |klass|
|
119
119
|
logger.log :debug, :yellow, "Checking #{klass.to_s.downcase} on #{path} ..."
|
120
|
-
check = Object.const_get(klass).new(@src, path, html, @options)
|
120
|
+
check = Object.const_get(klass).new(@src, path, html, @options, @typhoeus_opts, @hydra_opts, @parallel_opts)
|
121
121
|
check.run
|
122
122
|
result[:external_urls].merge!(check.external_urls)
|
123
123
|
result[:failed_tests].concat(check.issues) if check.issues.length > 0
|
@@ -5,13 +5,17 @@ module HTML
|
|
5
5
|
# Mostly handles issue management and collecting of external URLs.
|
6
6
|
class CheckRunner
|
7
7
|
|
8
|
-
attr_reader :issues, :src, :path, :options, :
|
8
|
+
attr_reader :issues, :src, :path, :options, :typhoeus_opts, :hydra_opts, :parallel_opts, \
|
9
|
+
:external_urls, :href_ignores, :alt_ignores
|
9
10
|
|
10
|
-
def initialize(src, path, html,
|
11
|
+
def initialize(src, path, html, options, typhoeus_opts, hydra_opts, parallel_opts)
|
11
12
|
@src = src
|
12
13
|
@path = path
|
13
14
|
@html = remove_ignored(html)
|
14
|
-
@options =
|
15
|
+
@options = options
|
16
|
+
@typhoeus_opts = typhoeus_opts
|
17
|
+
@hydra_opts = hydra_opts
|
18
|
+
@parallel_opts = parallel_opts
|
15
19
|
@issues = []
|
16
20
|
@href_ignores = @options[:href_ignore]
|
17
21
|
@alt_ignores = @options[:alt_ignore]
|
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'addressable/uri'
|
2
|
-
require 'cgi'
|
3
2
|
require_relative './utils'
|
4
3
|
|
5
4
|
module HTML
|
@@ -44,7 +43,7 @@ module HTML
|
|
44
43
|
end
|
45
44
|
|
46
45
|
def path
|
47
|
-
|
46
|
+
Addressable::URI.unencode parts.path unless parts.nil?
|
48
47
|
end
|
49
48
|
|
50
49
|
def hash
|
@@ -139,7 +138,7 @@ module HTML
|
|
139
138
|
end
|
140
139
|
|
141
140
|
def follow_location?
|
142
|
-
@check.
|
141
|
+
@check.typhoeus_opts && @check.typhoeus_opts[:followlocation]
|
143
142
|
end
|
144
143
|
|
145
144
|
private
|
data/lib/html/proofer/version.rb
CHANGED
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: 2.0.
|
4
|
+
version: 2.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Garen Torikian
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mercenary
|