Module: Todo
- Defined in:
- lib/tasky.rb,
lib/tasky/version.rb
Defined Under Namespace
Constant Summary collapse
- VERSION =
"0.1.0"
Class Method Summary collapse
- .edit ⇒ Object
- .editor ⇒ Object
- .help ⇒ Object
- .print_tasks(status = :todo) ⇒ Object
- .start(args) ⇒ Object
- .version ⇒ Object
Class Method Details
.edit ⇒ Object
60 61 62 |
# File 'lib/tasky.rb', line 60 def edit exec("#{editor} #{Todo::Task.file}") end |
.editor ⇒ Object
64 65 66 |
# File 'lib/tasky.rb', line 64 def editor ENV['VISUAL'] || ENV['EDITOR'] || 'vim' end |
.help ⇒ Object
68 69 70 71 |
# File 'lib/tasky.rb', line 68 def help puts 'Usage: todo [options] <args>' exit end |
.print_tasks(status = :todo) ⇒ Object
52 53 54 55 56 57 58 |
# File 'lib/tasky.rb', line 52 def print_tasks(status = :todo) pattern = status == :todo ? /^\[x/ : /^\[ / File.open(Task.file).each_line do |l| puts(l) unless l[pattern] end exit end |
.start(args) ⇒ Object
44 45 46 47 48 49 50 |
# File 'lib/tasky.rb', line 44 def start(args) = Options.parse args @task = Task.new args @task.save end |
.version ⇒ Object
73 74 75 |
# File 'lib/tasky.rb', line 73 def version VERSION end |