[Rake-devel] Grabbing tasks in a namespace

Zach Dennis zach.dennis at gmail.com
Fri Dec 28 11:00:37 EST 2007

There doesn't seem to be a nice interface for grabbing tasks in a
namespace. Naively, I tried Rake::NameSpace['my_namespace'] to see if
I got a NameSpace returned, which I didn't.

I have been using the following workaround:
   tasks = Rake.application.tasks.select{ |task| task.name =~
/app:dependencies/ }

I want to do this because I have a "app:dependencies" task which
ensures my system has all of the necessary application dependencies
installed.  Any task which is put inside of the "app:dependencies"
namespace will automatically be run as a dependency check.

Is there a better way to do this that exists beside my above
workaround? If not, would this functionality be considered if a patch
was submitted  for the NameSpace#[] method or is it seen as
unnecessary to rake itself?


Zach Dennis

More information about the Rake-devel mailing list