Forum: Ruby on Rails What's tasks for under the lib directory

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.
Dave B. (Guest)
on 2005-12-08 20:05
Looking over the new directory structure for Rails 0.14.3 generated by
the "rails myproject" command, I noticed a "lib/tasks" directory.
What's the purpose of the "tasks" directory?

Thanks
technoweenie (Guest)
on 2005-12-08 20:10
(Received via mailing list)
On 12/8/05, Dave B. <removed_email_address@domain.invalid> wrote:
> Looking over the new directory structure for Rails 0.14.3 generated by
> the "rails myproject" command, I noticed a "lib/tasks" directory.
> What's the purpose of the "tasks" directory?
>
> Thanks

Add your own rake tasks by creating a lib/tasks/*.rake file.  Before
the tasks were moved to railties, you'd have to add them to the bottom
of the massive Rakefile rails shipped with.

--
rick
http://techno-weenie.net
Jamie M. (Guest)
on 2005-12-08 20:14
(Received via mailing list)
On Thu, 2005-12-08 at 19:05 +0100, Dave B. wrote:
> Looking over the new directory structure for Rails 0.14.3 generated by
> the "rails myproject" command, I noticed a "lib/tasks" directory.
> What's the purpose of the "tasks" directory?
>
> Thanks
>

This directory is for any custom rake tasks you want to add to your
project.  They should be named with a .rake extension, and just contain
the body of the rake task.

For example, a quick one from one of the projects we're working on:

doc.rake
----
desc "Generate all documentation for application."
task :rdoc => [:appdoc, :libdoc, :plugindoc]


To use it, we can just run 'rake rdoc' from the commandline, and it will
find it.  Note that you specify the name of the task, not necessarily
the name of the file :P

- Jamie
This topic is locked and can not be replied to.