Class: Ilpomodoro::History

Inherits:
Object
  • Object
show all
Defined in:
lib/ilpomodoro/history.rb

Instance Method Summary collapse

Constructor Details

#initializeHistory



4
5
6
7
8
# File 'lib/ilpomodoro/history.rb', line 4

def initialize
  Logging.format_as(:yaml)
  Logging.logger.root.level = :info
  Logging.logger.root.appenders << get_appenders
end

Instance Method Details

#close(task) ⇒ Object



19
20
21
# File 'lib/ilpomodoro/history.rb', line 19

def close(task)
  log.info text_for(task, :closed)
end

#get_appendersObject



23
24
25
26
27
28
29
30
31
32
# File 'lib/ilpomodoro/history.rb', line 23

def get_appenders
  filename = '.ilpomodoro'
  folder_path = Pathname.new(`pwd`)
  home_path = Pathname.new('~/filename')

  Array.new.tap do |a|
    a << Logging.appenders.file(home_path)
    a << Logging.appenders.file(folder_path)
  end
end

#start(task) ⇒ Object



11
12
13
# File 'lib/ilpomodoro/history.rb', line 11

def start(task)
  log.info text_for(task, :start)
end

#wip(task) ⇒ Object



15
16
17
# File 'lib/ilpomodoro/history.rb', line 15

def wip(task)
  log.info text_for(task, :wip)
end