Method: Timetrap::Timer#current_sheet

Defined in:
lib/timetrap/timer.rb

#current_sheetObject



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/timetrap/timer.rb', line 64

def current_sheet
  unless Meta.find(:key => 'current_sheet')
    Meta.create(:key => 'current_sheet', :value => 'default')
  end

  if the_auto_sheet = auto_sheet
    unless @auto_sheet_warned
      warn "Sheet #{the_auto_sheet.inspect} selected by Timetrap::AutoSheets::#{::Timetrap::Config['auto_sheet'].capitalize}"
      @auto_sheet_warned = true
    end
    the_auto_sheet
  else
    Meta.find(:key => 'current_sheet').value
  end
end