html-proofer 2.6.2 → 2.6.3
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/lib/html/proofer.rb +18 -12
- data/lib/html/proofer/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6964d1ee614f0d898f0bfc8d26c5fd31b68cc5c0
|
4
|
+
data.tar.gz: 236418a82ce34b84911962f5b1215457ef09e5d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ee9907b79951bbcc9884dcde1f7c97b304205be8dbd029ce91c2b69b7f46e5f039373df573548a03714fceb010454d171f6381c86a9a94439e9890909389304
|
7
|
+
data.tar.gz: 3994c7b5d56e4867b1a7bc1b6ed877d5b7fcdabb7fb5de260244dccd6062a6154b59b345ecfec860526ca62ddea69c170977cbe5bf609230effc6e85f7756a80
|
data/lib/html/proofer.rb
CHANGED
@@ -113,21 +113,27 @@ module HTML
|
|
113
113
|
|
114
114
|
# Walks over each implemented check and runs them on the files, in parallel.
|
115
115
|
def check_files_for_internal_woes
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
checks.each do |klass|
|
121
|
-
logger.log :debug, :yellow, "Checking #{klass.to_s.downcase} on #{path} ..."
|
122
|
-
check = Object.const_get(klass).new(@src, path, html, @options, @typhoeus_opts, @hydra_opts, @parallel_opts, @validation_opts)
|
123
|
-
check.run
|
124
|
-
result[:external_urls].merge!(check.external_urls)
|
125
|
-
result[:failed_tests].concat(check.issues) if check.issues.length > 0
|
126
|
-
end
|
127
|
-
result
|
116
|
+
if @parallel_opts.empty?
|
117
|
+
Parallel.map(files) { |path| check_path(path) }
|
118
|
+
else
|
119
|
+
Parallel.map(files, @parallel_opts) { |path| check_path(path) }
|
128
120
|
end
|
129
121
|
end
|
130
122
|
|
123
|
+
def check_path(path)
|
124
|
+
html = create_nokogiri(path)
|
125
|
+
result = { :external_urls => {}, :failed_tests => [] }
|
126
|
+
|
127
|
+
checks.each do |klass|
|
128
|
+
logger.log :debug, :yellow, "Checking #{klass.to_s.downcase} on #{path} ..."
|
129
|
+
check = Object.const_get(klass).new(@src, path, html, @options, @typhoeus_opts, @hydra_opts, @parallel_opts, @validation_opts)
|
130
|
+
check.run
|
131
|
+
result[:external_urls].merge!(check.external_urls)
|
132
|
+
result[:failed_tests].concat(check.issues) if check.issues.length > 0
|
133
|
+
end
|
134
|
+
result
|
135
|
+
end
|
136
|
+
|
131
137
|
def validate_urls
|
132
138
|
url_validator = HTML::Proofer::UrlValidator.new(logger, @external_urls, @options, @typhoeus_opts, @hydra_opts)
|
133
139
|
@failed_tests.concat(url_validator.run)
|
data/lib/html/proofer/version.rb
CHANGED