El Viernes 03 Abril 2009, Elias Orozco escribi:
> Hello guys,
>
> I have a folder that contains several classes. There are some some
> dependencies between them as one class could extend from another one
> included in the folder. I am trying to require them all dynamically but
> I get:
>
> uninitialized constant <name of the class>
>
> This happens because I try to require a class that extends from a class
> I haven't require yet. So can anyone help or give me any hint on how to
> load them all dynamically and deal with those dependencies?

path = File.dirname(__FILE__) + "/files_dir"

require "#{path}/required_file1"
require "#{path}/required_file2"
require "#{path}/required_file3"

Dir.chdir(path)
Dir["*.rb"].each do |file|
        require "#{path}/#{file}"
end


-- 
Iaki Baz Castillo <ibc / aliax.net>