Let\'s say we have two classes, Foo and Foo Sub, each in a different file, foo.rb and foo_sub.rb respectively.
foo.rb:
require \"foo_sub\"
class Foo
Another decent option is to use the autoload feature of Ruby.
It works like this:
module MyModule
autoload :Class1, File.join(File.dirname(__FILE__), *%w[my_module class1.rb])
autoload :Class2, File.join(File.dirname(__FILE__), *%w[my_module class2.rb])
# Code for MyModule here
end
and is described well here:
http://talklikeaduck.denhaven2.com/2009/04/06/all-that-you-might-require