Forum: Ruby on Rails Automatic namespacing of custom Rake tasks

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
1e99128ebac5ca41c91940291d315332?d=identicon&s=25 Luke Redpath (Guest)
on 2006-03-21 21:00
(Received via mailing list)
As you know you can create your own .rake files in lib/tasks and
Rails will automatically find them - as Rake 0.7 adds namespace
support and Rails is already taking advantage of these namespaces if
you are on Edge Rails I thought it would make a lot of sense if Rails
automatically namespaced your own custom rake files, so I raised a
ticket for this and I've now implemented it myself and created a patch.

Creating tasks in lib/tasks/foo.rake will make all of your tasks in
that file available in the namespace foo e.g. foo:bar, foo:baz

This is only for people running on Edge Rails - hopefully it will be
included into the core for 1.1.

A word of warning - this of course means that any existing custom
tasks you have will now need to be accessed using the appropriate
namespace. I'm not sure how well this play with capistrano. for the patch.

Luke Redpath
This topic is locked and can not be replied to.