lib/task_manager.rb in task_manager2-0.0.14 vs lib/task_manager.rb in task_manager2-0.0.15
- old
+ new
@@ -51,9 +51,19 @@
DoneTaskFile.new.add(task)
print('Finished task:'.colorize(:light_green))
print_task(task)
end
+ def self.finish_with_id(id)
+ task = NewTaskFile.new.pick(id) do |task|
+ DoneTaskFile.new.add(task)
+ end
+ print('Finished task:'.colorize(:light_green))
+ print_task(task)
+ rescue Exception => e
+ print e.message
+ end
+
def self.stats
print('Waiting tasks:'.colorize(:light_cyan))
NewTaskFile.new.all.each do |task|
print_task(task)
end