# What's tasks for under the lib directory

**URL:** <https://www.ruby-forum.com/t/whats-tasks-for-under-the-lib-directory/49782>\
**Category:** Rails\
**Created:** [December 8, 2005, 7:05pm UTC](https://www.ruby-forum.com/t/whats-tasks-for-under-the-lib-directory/49782 "2005-12-08T19:05:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![daz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/87869e/32.png) [@daz](https://www.ruby-forum.com/u/daz)\
**Post date:** [December 8, 2005, 7:05pm UTC](https://www.ruby-forum.com/t/whats-tasks-for-under-the-lib-directory/49782/1 "2005-12-08T19:05:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![daz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/87869e/32.png) [@daz](https://www.ruby-forum.com/u/daz)\
**Post date:** [December 8, 2005, 7:10pm UTC](https://www.ruby-forum.com/t/whats-tasks-for-under-the-lib-directory/49782/2 "2005-12-08T19:10:47Z")

</div>

On 12/8/05, Dave B. [removed\_email\_address@domain.invalid](mailto: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](http://techno-weenie.net)

---

<div class="post-metadata">

**Author:** ![daz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/87869e/32.png) [@daz](https://www.ruby-forum.com/u/daz)\
**Post date:** [December 8, 2005, 7:14pm UTC](https://www.ruby-forum.com/t/whats-tasks-for-under-the-lib-directory/49782/3 "2005-12-08T19:14:52Z")

</div>

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 😛

- Jamie
