From: shasckaw Date: 2004-03-10T23:14:40+09:00 Subject: Re: require is excluding too much Simon Strandgaard wrote: > Is this a bug? > Shouldn't 'require' load both modules in this case? > If not, what is the motivation for doing so? > > Just curious :-) > > -- > Simon Strandgaard [snip] > require 'mod' > $:.unshift('dir') > require 'mod' > server> ruby a.rb > hello1 > server> ls > a.rb dir/ mod.rb > server> > > I would have expected it to output both 'hello1' and 'hello2'. Hello Simon! When requiring a module twice, it is probable that ruby just use its name to check if it has to reload it or not, forgetting to also check if it is in a different directory or not. You can do this instead: require 'mod' require 'dir/mod' Lio