Class: Achoo::App

Inherits:
Object
  • Object
show all
Includes:
UI::Commands, UI::ExceptionHandling, UI::RegisterHours
Defined in:
lib/achoo/app.rb

Instance Method Summary collapse

Methods included from UI::RegisterHours

#all_projects_chooser, #billing_chooser, #chooser_helper, #hours_chooser, #phase_chooser, #print_hours_help, #print_remark_help, #project_chooser, #register_hours, #remark_chooser, #workperiod_chooser

Methods included from UI::ExceptionHandling

#get_exception_reason, #handle_exception, #handle_fatal_exception

Methods included from UI::DateChoosers

#date_chooser, #month_chooser, #optionally_ranged_date_chooser

Methods included from UI::Commands

#lock_month, #show_flexi_time, #show_holiday_report, #show_registered_hours_for_day, #show_registered_hours_for_week, #view_report

Methods included from UI::Common

#confirm

Constructor Details

#initialize(log = false) ⇒ App

Returns a new instance of App.



17
18
19
20
21
22
# File 'lib/achoo/app.rb', line 17

def initialize(log=false)
  @agent = Mechanize.new
  if log
    @agent.log = Logger.new("achoo_http.log")
  end
end

Instance Method Details

#startObject



25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/achoo/app.rb', line 25

def start
  begin
    print_welcome
    warm_up_ical_cache
    
    scrape_urls
    command_loop
  rescue SystemExit => e
    raise
  rescue Exception => e
    handle_fatal_exception("Something bad happened. Shutting down.", e)
  end
end