Is it possible to get a list of all available rake tasks in a namespace?

rake, ruby

Solution

I've found out the answer:

tasks = Rake.application.tasks

This will return an array of Rake::Task objects that can be examined. Further details at http://rake.rubyforge.org/

Problem

Is it possible from within a rake task to get a list of tasks in a namespace? A sort of programatic 'rake -T db' ?

Original source