Rake and multiple arguments
Beware of spaces when passing Rake arguments.
Rake has a new syntax for passing arguments. In the old version it looked something like this:
Running this task in a newer version of Rake shows a deprecation warning:
WARNING: 'task :t, arg, :needs => [deps]' is deprecated. Please use 'task :t, [args] => [deps]' instead.
Luckily it’s easy to switch to the newer syntax:
A word of caution
I took me some time to figure out why my rake task wouldn’t accept multiple parameters. All I got was the following error:
Don't know how to build task 'greeter:hello[John,'
This, of course, has nothing to do with the new syntax as I thought but the space between my arguments on the command line.
Standard UNIX stuff, I know, but still… sneaky.