# What's up with the lib folder?

**URL:** <https://www.ruby-forum.com/t/whats-up-with-the-lib-folder/89524>\
**Category:** Engines Development\
**Created:** [January 4, 2006, 8:54pm UTC](https://www.ruby-forum.com/t/whats-up-with-the-lib-folder/89524 "2006-01-04T20:54:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![seth](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f14d63/32.png) [@seth](https://www.ruby-forum.com/u/seth)\
**Post date:** [January 4, 2006, 8:54pm UTC](https://www.ruby-forum.com/t/whats-up-with-the-lib-folder/89524/1 "2006-01-04T20:54:08Z")

</div>

I noticed I have a structure like this…

…/plugins/my\_engine/lib/my\_engine

Inside of …/lib I also have a my\_engine.rb

What’s the purpose of this? I can’t find anything on the wiki about it.

Thanks.

---

<div class="post-metadata">

**Author:** ![seth](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f14d63/32.png) [@seth](https://www.ruby-forum.com/u/seth)\
**Post date:** [January 5, 2006, 12:54am UTC](https://www.ruby-forum.com/t/whats-up-with-the-lib-folder/89524/2 "2006-01-05T00:54:26Z")

</div>

The structure you have is very general, since it’s most likely from  
the generator. The thought is that you have a single point of  
inclusion for your engine libraries, so you can simply do

require ‘my\_engine’

which will load the file “my\_engine/lib/my\_engine.rb”. To keep things  
tidy, any library code that you define should be placed in  
my\_engine/lib/my\_engine/, but equally you might have other libraries  
in my\_engine/lib/whatever.

Of course, it’s totally up to you what you place in lib, and what  
structure you use - the only thing that is even semi-expected is that  
you have an init\_engine.rb (and that’s not even necessary).

Sorry if that explanation isn’t clear, it’s quite late 🙂

- james
