From: "Thomas B." Date: 2008-10-11T20:33:54+09:00 Subject: Re: Automatic ClassLoader (to eliminate 'require') Alexey Petrushin wrote: > Thanks! It works! :) Hi there. That's a nice solution, I think. Thanks for sharing! There might be some drawbacks in this approach, like now you cannot require these files manually because it wouldn't create the correct module nesting, but for some applications I think your code is great. Things that you probably could improve: - There's a constant named TOPLEVEL_BINDING, you can use it instead of your own constant. - You could backup the original const_missing and call it if the const is really missing: class Module alias const_missing_orig const_missing def const_missing(const) ... else const_missing_orig(const) end end end - Also I think there might be a more elegant way to create the class from the file in the correct nesting. There might be a way to do it using some class_eval or something, but I'll have to test it. TPR. -- Posted via http://www.ruby-forum.com/.