Hey, top-posting is annoying. You're replying above what everyone else wrote, 
which means people have no context.

On Friday 03 April 2009 16:18:55 Elias Orozco wrote:
> Hi Joel thanks for the reply. The idea is to load them at once. Without
> specifying requires inside each class.

Requires don't need to be inside classes, just files. You can have more than 
one class per file, or a file that takes up multiple classes.

> I have seen that when I put a
> series of classes on the rails lib folder everything loads without
> problem. I have looked into rails itself, but I don't get how it does
> that.

Rails intercepts Object#cost_missing, and uses that to load anything with the 
same name. Basically, this means that the first time you try to use a class, it 
gets loaded.

I wrote a little library that does something similar, but with Kernel#autoload 
instead -- it's slightly faster and more flexible:

http://github.com/masover/autoloader

You can install that, and it will either use activesupport (from Rails), or 
extlib (used by Merb), depending what's available (or what you already 
loaded).

If it doesn't work for you, it should be small enough to be readable.