lib/task_manager.rb in task_manager2-0.0.15 vs lib/task_manager.rb in task_manager2-0.0.16
- old
+ new
@@ -28,10 +28,19 @@
print_task(task)
rescue Exception => e
print e.message
end
+ def self.undo
+ task = CurrentTaskFile.new.pick
+ NewTaskFile.new.add(task)
+ print('Undid task:'.colorize(:light_cyan))
+ print_task(task)
+ rescue Exception => e
+ print e.message
+ end
+
def self.delete(id)
task = NewTaskFile.new.delete(id)
print('Deleted task:'.colorize(:light_cyan))
print_task(task)
rescue Exception => e
@@ -49,9 +58,11 @@
def self.finish
task = CurrentTaskFile.new.pick
DoneTaskFile.new.add(task)
print('Finished task:'.colorize(:light_green))
print_task(task)
+ rescue Exception => e
+ print e.message
end
def self.finish_with_id(id)
task = NewTaskFile.new.pick(id) do |task|
DoneTaskFile.new.add(task)