Find Where a Rake Task is Defined
In any Rails application you can see which rake tasks are available - either by running rake -AT
(or rake --all --tasks)
to see all tasks, or rake -T
(or rake --tasks
) to see all tasks with descriptions.
However, today I learnt you can also see where a rake task is defined by running rake -W
(or rake --where
). This is useful if a gem is adding a rake task and you want to look at the source.
All of these commands also take an optional pattern to filter the results.