Are the following equivalent?
namespace :resque do
task setup: :environment do
end
end
task "resque:setup" => :environment do
end
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In short: yes. When running
rake resque:setupboth of these tasks will be invoked.Rake will merge these tasks. You can test this by doing the following:
Which in this case would return something like
Which is simply an Array holding a single
Rake::Taskobject. You can also check the scope or list of namespaces for a task by doing:If you want to learn a little more on how the internals of Rake work, check out Rake::Task and Rake::TaskManager