Class: WebChecker::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/web_checker.rb

Instance Method Summary collapse

Instance Method Details

#startObject



56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/web_checker.rb', line 56

def start
  trap("INT") { self.stop }

  begin
    @checker = WebChecker::Workflow.new(options)
  rescue WebChecker::NotHttpURIError, WebChecker::InvalidHostError => e
    puts "--url error. #{e.message}"
    exit
  end

  EventMachine.run do
    @checker.run
  end
end