Programming Ruby 3.2 (5th Edition): B1.0 page 247, rake delete_backups[code]


page 247, last command :

$ rake delete_backups[code]

If the Rakefile contains only def delete(dir, pattern) and the task :delete_unix_backups, as above the previous paragraph, the command must be :

$ rake delete_unix_backups[code]

If the Rakefile from pages 246-7 is modified for Unix and not Windows, there is an ArgumentError :

% rake delete_backups[code]
rake aborted!
ArgumentError: wrong number of arguments (given 1, expected 2)
.../Rakefile:1:in `delete'
.../Rakefile:13:in `block in <top (required)>'
.../gems/rake-13.0.3/exe/rake:27:in `<top (required)>'
Tasks: TOP => delete_backups => delete_windows_backups

I can see where this is unclear, the task is defined in the text of the previous paragraph, not in the code sample. I’ll amend the code sample to match. Thanks.