Somehow Rspec and Cucumber are making it into my default rake task (which is fine because I want them there). But I have tried adding additional tasks to the default task and it has no effect.
What is the proper way to add tasks to the default rake task?
Typically your Rakefile will have something like this:
task :default => [:spec]
You just need to add more tasks into this list.
The answer from davogenes is correct for non-namespaced rake tasks.
If you want to have a default task in namespaces you need to do the following
namespace :mynamespace do desc "This should be the default" task :mydefault do Do.something_by_default end desc "Another task in this namespace" task :other do Do.something end end desc "This is the default task of mynamespace" task mynamespace: 'mynamespace:mydefault'
Then you can run rake mynamespace
as well as rake mynamespace:other
or rake mynamespace:mydefault
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With