Class: FaviconCheck
- Inherits:
-
HTMLProofer::Check
- Object
- HTMLProofer::Check
- FaviconCheck
- Defined in:
- lib/html-proofer/check/favicon.rb
Instance Attribute Summary
Attributes inherited from HTMLProofer::Check
#element, #external_urls, #html, #issues, #node, #options, #path, #src
Instance Method Summary collapse
Methods inherited from HTMLProofer::Check
#add_issue, #add_path_for_url, #add_to_external_urls, #blank?, #create_element, #initialize, subchecks
Constructor Details
This class inherits a constructor from HTMLProofer::Check
Instance Method Details
#run ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/html-proofer/check/favicon.rb', line 4 def run found = false @html.xpath('//link[not(ancestor::pre or ancestor::code)]').each do |node| favicon = create_element(node) next if favicon.ignore? found = true if favicon.rel.split(' ').last.eql? 'icon' break if found end return if found return if immediate_redirect? add_issue('no favicon specified') end |