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, #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.



22
23
24
25
26
27
# File 'lib/achoo/app.rb', line 22

def initialize(log=false)
  @last_used_date = Date.today
  if log
    AGENT.log = Logger.new("achoo_http.log")
  end
end

Instance Method Details

#startObject



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/achoo/app.rb', line 30

def start
  begin
    PLUGINS.load_plugins
    puts PLUGINS.log if ENV['ACHOO_DEBUG']
    PLUGINS.send_at_startup
    print_welcome
    
    scrape_urls
    #print_homescreen
    command_loop
  rescue SystemExit => e
    raise
  rescue Exception => e
    handle_fatal_exception("Something bad happened. Shutting down.", e)
  end
end