From: Stefan Rusterholz Date: 2007-07-02T01:42:03+09:00 Subject: Re: Given a class, what is the 'require' line? Alex Young wrote: > Stefan Rusterholz wrote: >>> builtin way of doing it. >> unconventional libs requiring the file following the convention to keep >> backwards-compatibility (e.g. strscan.rb just containing a line 'require >> "stringscanner.rb"'). > > In general, I agree, and this precise problem has annoyed the hell out > of me in the past. However, you also need to take into account those > libraries that provide more than one class or namespace, or those that > primarily modify core classes. It's not insurmountable, by any means. I keep everything that modifies core classes under a dir called "ruby", so I do e.g. require 'ruby/array/sum' (I can also require 'ruby/array', which will require all sub-files) I'm still missing a good strategy for singleton methods, though. Namespaces are mapped to directories in my libs. Stdlib does for a lot of that the same, consider all the Net::* stuff, it maps to net/* Regards Stefan -- Posted via http://www.ruby-forum.com/.