Module: Crabfarm::Modes::Live

Extended by:
Live
Included in:
Live
Defined in:
lib/crabfarm/modes/live.rb

Instance Method Summary collapse

Instance Method Details

#start_watchObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/crabfarm/modes/live.rb', line 10

def start_watch
  Utils::Console.system 'Starting crabfarm live'

  begin
    Crabfarm.enable_debugging!
    Crabfarm.install_live_backend!
    Crabfarm.live.start

    controller = Crabfarm::Live::Controller.new Crabfarm.live
    watcher = Crabfarm::Live::Watcher.new controller
    watcher.watch 0.2

  rescue SystemExit, Interrupt
    # nothing
  rescue Exception => exc
    Utils::Console.error "Fatal error!"
    Utils::Console.exception exc
  ensure
    Utils::Console.system 'Exiting'
    Crabfarm.live.stop
  end
end