Module: TodayDo

Defined in:
lib/todaydo.rb

Class Method Summary collapse

Class Method Details

.pickObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/todaydo.rb', line 5

def self.pick
  s = SourceAnnotationExtractor.new "TODO"
  todos = s.find

  files = todos.keys.sort

  d = Date.today
  file_index = d.month % files.length

  file_name = files[file_index]
  file = todos[file_name]
  
  todo_index = d.day % file.length
  todo = file[todo_index]

  puts file_name
  puts todo
end