From: Austin Ziegler Date: 2005-11-23T03:54:19+09:00 Subject: Re: There must be a better way -- requiring multiple files On 11/22/05, Mauricio Fern�ndez wrote: > On Wed, Nov 23, 2005 at 02:29:16AM +0900, Berger, Daniel wrote: > > Could Kernel#require be modified to understand '*' (non-recursive) and > > '**' (recursive)? Then you could do: > > > > require "net/*" # require all .rb files under the net directory > > require "net/**" # Same, but recursive > > > > I seem to recall this being proposed in the past, but I can't remember > > the arguments against it. > You could add to them that it'd pose some problems with RubyGems' new > definition of Kernel#require. Yeah, but I think that there are enough potential problems with the idea that one wouldn't even have to reach that far down the list to kill it. 1. The search time would be high, since Ruby would have to look in all of $LOAD_PATH. 2. It would be *massively* insecure. Even what I do in Ruwiki isn't safe from that perspective. It would be better to have a single file that you load that contains the names of the files you want to load. -austin -- Austin Ziegler * halostatue@gmail.com * Alternate: austin@halostatue.ca