after the GLI scaffold the app doesn't do anything Chapter 2
06 Feb 2013, 20:14
Leonel Santos (11 posts)
This is just ONE example of several, I could say the same about the list and done commands.
According to the instructions on the book and the downloaded source code, this is what the new command is supposed to do (page 28 /be_easy_to_use/todo/bin/todo_integrated.rb).
fast-forward to chapter 4 Play Well and this is what the new command is supposed to do (/play_well/todo/bin/todo)
I run the code I typed, I run the source code I downloaded, IT DOES NOT NOT NOT add any new items to ANY FILE.
What’s the deal here? Obviously the new command is not doing anything.
Are those commands NOT SUPPOSED TO work at this point? Is that the expected behavior?
Are we the readers SUPPOSED TO fill-in the blanks and figure out the code ourselves?
I thought this was supposed to be a tutorial-like, hands-on book; not a figure it out yourself book. Please let me know if I’m doing something wrong or if there are some mistakes in the book.
08 Feb 2013, 19:42
David Copeland (96 posts)
What is being demonstrated is everything aside from the to-do list logic. The first example is showing you how to access the command line options at runtime, while the second example is showing you how to document your various commands and options. This isn’t relevant to actually making a todo list, and I didn’t want to get sidetracked with explaining how to open or append to files so as to make a working todo list.
I believe that the actual logic of a todo list (which would be the code that goes into the @action@ blocks of the various commands), should be a straightforward enough thing to add and make the examples into a real to-do list.
So, it is a tutorial for using GLI and related libraries, not on making a todo list or database backup app. You should hopefully be able to apply knowledge of GLI, OptionParser and friends to any particular problem.
|You must be logged in to comment|