samwho/todo-txt-gem — pull request #2 by nusco (2013-03-17 13:03:18+00:00)
Title: Mark tasks as done/undone

I have no idea whether you ever intended this gem to be able to change data, as well as read it. If it's used to build applications, then I cannot imagine many applications wanting to visualize the tasks without editing them.

I added the zero-level functionality of an editable to-do list: toggling tasks from done to undone. When you mark a task as done, its completion date is set to the current date. When you mark it as undone, it reverts to the original due date and priority.

I had to add a Task#to_s method that converts the task back to a Todo.txt line, and I changed some code that was getting in the way of the new logics (like lazy calculation of Task instance variables).

Still no way to set the individual "fields" of a task, edit the list, or save back to Todo.txt - but it's a start.

Even if you don't want the new functionality, feel free to cherry-pick any specific commits that you like. I cleaned up and fixed a few things along the way.

Thanks!