Class: ValidateWebsite::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/validate_website/runner.rb

Overview

Runner for command line use and clean exit on ctrl-c

Class Method Summary collapse

Class Method Details

.run_crawl(args) ⇒ Object


15
16
17
18
19
20
# File 'lib/validate_website/runner.rb', line 15

def self.run_crawl(args)
  trap_interrupt
  validate_website = ValidateWebsite::Crawl.new(args)
  validate_website.crawl
  validate_website.exit_status
end

.run_static(args) ⇒ Object


22
23
24
25
26
27
# File 'lib/validate_website/runner.rb', line 22

def self.run_static(args)
  trap_interrupt
  validate_website = ValidateWebsite::Static.new(args)
  validate_website.crawl
  validate_website.exit_status
end

.trap_interruptObject


8
9
10
11
12
13
# File 'lib/validate_website/runner.rb', line 8

def self.trap_interrupt
  trap('INT') do
    warn "\nExiting..."
    exit!(1)
  end
end