By Developers, For Developers

Historical errata for Build Awesome Command-Line Applications in Ruby 2

PDF PgPaper PgTypeDescriptionFixed onComments
118TYPO

Chapter 8 Section8.1 Paragraph 2:
Rather than solve this problem at the same we learn about the mechanics of
testing, let’s take things one step at a time.

might need ‘time’ between same and we?

2014-06-18
168SUGGEST

Rainbow gem notice: Sickill::Rainbow.enabled= is deprecated, use Rainbow.enabled= instead.

2014-06-18
42ERROR

The code on the page sets the default_value of the todo command’s filename flag to “~/.todo.txt”. This causes trouble later, because Ruby’s File.open does not do shell expansion on its filename argument. A default_value that works is “#{ENV[‘HOME’]}/.todo.txt”.

2014-06-18
126ERROR

On this page we’re adding code to Cucumber’s env.rb, to modify ENV[‘HOME’] so a test won’t touch the user’s real todo list. Paragraph three begins, “As you can see, we create a fresh, empty directory and point ENV[‘HOME’]to it.” Actually, the code only removes the old fake_home directory. It does not create a new one, and this omission causes the test to fail. To fix the code, insert this line after the directory is removed:

FileUtils.mkdir fake_home

This is not my experience. Running the tests with nothing in /tmp and everything works fine. Can you post to the forum what you are seeing specifically?
20TYPO

opts.on(“- i”,“–iteration”) => opts.on(“- i”,“–-iteration”)

2015-10-30
26SUGGEST

running the command “bundle exec bin/todo new” produce an error if all the gems are not installed.
The error is:
“Could not find gem ‘aruba (>= 0) ruby’ in the gems available on this machine.
Run `bundle install` to install missing gems.”
I suggest to run bundle install before.

2015-10-30
29ERROR

“bin/todo -f ~/todo.txt new -f ”A new task" “Another task”
the right command is
“bundle exec bin/todo -f ~/todo.txt new -f ”A new task" “Another task”

otherwise a specific error message are raised: ("In development, you need to use `bundle exec bin……)

2015-10-30
5ERROR

These lines are missing the concatenation of underscore into the filename string.

backup_file = database + Time.now.strftime(“%Y%m%d”)
backup_file = database + end_of_iter

and should be

backup_file = database + ‘_’ + Time.now.strftime(“%Y%m%d”)
backup_file = database + ‘_’ + end_of_iter

Since the names produced include an underscore:

$ db_backup.rb small_client small “p@ssWord!”

  1. => creates small_client_20110103.sql.gz
    $ db_backup.rb big_client big big iteration_3
  2. => creates big_client_iteration_3.sql.gz
2015-10-30
8ERROR

Should todo have an extention RB?? it does not work on Windows without extention.

Categories: