Passing command line arguments to a rake task
Creating a rake task
So this is the general way of using your rake task.
desc "Description of what this task does" task :myraketask => :environment do .. .. endOnce you have created a rake file(File with extension as .rake) and placed in /lib/task folder in your application.You can check
rake -Tfor all the avaliable tasks, Your custom task will also be listed here with the description you have mentioned.
So this is the general way of using your rake task.
rake myraketaskAnd if you wanted to pass any sort of arguments to your rake task , you can do this by
rake myraketask foo=barSo the argument foo can be accessed by
ENV['foo']in your task.
Comments
Post a Comment