Class: ValidateWebsite::Crawl
- Defined in:
- lib/validate_website/crawl.rb
Overview
Class for http website validation
Constant Summary
Constants inherited from Core
ValidateWebsite::Core::EXIT_FAILURE_MARKUP, ValidateWebsite::Core::EXIT_FAILURE_MARKUP_NOT_FOUND, ValidateWebsite::Core::EXIT_FAILURE_NOT_FOUND, ValidateWebsite::Core::EXIT_SUCCESS, ValidateWebsite::Core::START_MESSAGE
Instance Attribute Summary collapse
-
#crawler ⇒ Object
readonly
Returns the value of attribute crawler.
Attributes inherited from Core
#errors_count, #host, #not_founds_count, #options, #site
Instance Method Summary collapse
- #crawl(options = {}) ⇒ Object
- #history_count ⇒ Object
-
#initialize(options = {}, validation_type = :crawl) ⇒ Crawl
constructor
A new instance of Crawl.
Methods inherited from Core
#default_cookies, #errors?, #exit_status, #not_founds?
Methods included from ColorfulMessages
#color, #error, #info, #note, #success, #warning
Constructor Details
#initialize(options = {}, validation_type = :crawl) ⇒ Crawl
Returns a new instance of Crawl.
11 12 13 14 |
# File 'lib/validate_website/crawl.rb', line 11 def initialize( = {}, validation_type = :crawl) super (@site) end |
Instance Attribute Details
#crawler ⇒ Object (readonly)
Returns the value of attribute crawler.
9 10 11 |
# File 'lib/validate_website/crawl.rb', line 9 def crawler @crawler end |
Instance Method Details
#crawl(options = {}) ⇒ Object
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/validate_website/crawl.rb', line 26 def crawl( = {}) @options = @options.merge() @options[:ignore_links] = @options[:exclude] if @options[:exclude] @crawler = spidr_crawler(@site, @options) print_status_line(@crawler.history.size, @crawler.failures.size, @not_founds_count, @errors_count) end |
#history_count ⇒ Object
16 17 18 |
# File 'lib/validate_website/crawl.rb', line 16 def history_count crawler.history.size end |