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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 311de608f713bcaada4670afa181678fbf5b5e4b
4
- data.tar.gz: ac8cd3b02e564a6b18eaf64776cd48747c548095
3
+ metadata.gz: 38bdb56d1187e2c55f121acd5cc188c19f9cf6b4
4
+ data.tar.gz: 78f2f907207b977c5ddf14d832a090dcc128d80d
5
5
  SHA512:
6
- metadata.gz: 87e79c6cdbafd2de53d8cf3d3cebd35deaf0316b696b1df1d9b2dabdeec8f3bb5336b7bd4f9bd2f39aa7a4be3d3be50b2b06708d56067b0b0516790acf7921c5
7
- data.tar.gz: 9cc6bf9d3e2f65a2db4dd521d201bdb86f33e55d829e41b16c50c4404a857bebb453251fafbbd36c42bbddf2c5b310d5eb6779a81b814d0e1856897093c49a70
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, "octocat_link", self
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, :external_urls, :href_ignores, :alt_ignores
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, opts={})
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 = opts
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
- CGI.unescape parts.path unless parts.nil?
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.options[:typhoeus] && @check.options[:typhoeus][:followlocation]
141
+ @check.typhoeus_opts && @check.typhoeus_opts[:followlocation]
143
142
  end
144
143
 
145
144
  private
@@ -1,6 +1,6 @@
1
1
  module HTML
2
2
  class Proofer
3
- VERSION = '2.0.5'
3
+ VERSION = '2.0.6'
4
4
  end
5
5
  end
6
6
 
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.5
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-03 00:00:00.000000000 Z
11
+ date: 2015-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mercenary