Module: TodoTxt
- Defined in:
- lib/todo_txt_rb.rb,
lib/todo_txt_rb/list.rb,
lib/todo_txt_rb/todo.rb
Defined Under Namespace
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.init_config ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/todo_txt_rb.rb', line 12 def self.init_config default_config = {'todo_file_location' => Dir.home.to_s + '/todo.txt'} File.open(Dir.home.to_s + '/.todocfg.yml', "w") do |file| file.write("# todo_file_location should be set to the location of your todo.txt\n") file.write(default_config.to_yaml) end end |
Instance Method Details
#print_todo_list(list) ⇒ Object
8 9 10 |
# File 'lib/todo_txt_rb.rb', line 8 def print_todo_list list list.list.each_with_index{|todo, index| puts "#{index + 1} #{todo}"} end |