Build Awesome Command-Line Applications in Ruby

Build Awesome Command-Line Applications in Ruby

Again, I’m following the instructions of the book. If you follow the instructions of the book, for the db_backup application you only have the db_backup.rb file inside of a folder, that’s it. (Chapter 3 and beginning of Chapter 4)

But the code that you download has a lot of files and folders not specified in the book. The db_backup application is supposed to have a bin folder and Gemfile a lib and man folder and features folder. WHEN DID ALL OF THAT HAPPENED?!

We are reading the book and then out of nowhere folders and files appear out of nowhere. If we are gradually coding a command-line application, we would like to know how to do it from scratch instead of just having some files and folders fed to us.

I would suggest following what the book says - much of the code in the tarball was there for me, or are copies of the files in progress to show a progression. The main reason that early parts of the code have gemfiles etc. is so that I could run tests on the code as I wrote the book. In chapter 7, the gemspec/Gemfile is explained and in chapter 9, the canonical directory structure is documented. This seemed like to much to get into early in the book, but, the Gemfile provided at the top of the tarball should contain everything you need to run the early examples from their given locations.

There is a supplemental page here: http://www.awesomecommandlineapps.com/setup.html that goes over setup for unix-like systems that uses RVM. I was unable to get a repeatable setup for Windows so this section got omitted from the book. Hopefully this will help.