Forum: Ruby on Rails Automatic namespacing of custom Rake tasks

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Luke R. (Guest)
on 2006-03-21 22: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.

http://dev.rubyonrails.org/ticket/4342 for the patch.

Cheers,
Luke R.
removed_email_address@domain.invalid
This topic is locked and can not be replied to.