I have a rake task that needs to insert a value into multiple databases.
I\'d like to pass this value into the rake task from the command line, or from another
I use a regular ruby argument in the rake file:
DB = ARGV[1]
then I stub out the rake tasks at the bottom of the file (since rake will look for a task based on that argument name).
task :database_name1
task :database_name2
command line:
rake mytask db_name
this feels cleaner to me than the var=foo ENV var and the task args[blah, blah2] solutions.
the stub is a little jenky, but not too bad if you just have a few environments that are a one-time setup