From: Gregory Brown Date: 2006-06-14T07:45:17+09:00 Subject: Re: Gemspec option to prevent auto-require? On 6/13/06, Eric Hodel wrote: > On Jun 13, 2006, at 3:21 PM, Gregory Brown wrote: > > > I'm wondering if anyone knows an option I can put in my gemspec to > > prevent rubygems from requiring all my dependencies as soon as I > > require my library. > > > > It's okay that gems will inforce their dependencies, (throw an error > > if the gems arent there), but I don't want them all to load at once. > > > > In my library, I've got a bunch of requires in my methods, and I want > > them to require those libs only when they are called. > > > > so for instance : > > > > require "rubygems" > > require "ruport" #depends on fastercsv, but should not load it at > > this point > > ruport will be loaded here regardless of rubygems. That is not what I am referring to. I don't want fastercsv to be loaded at this point. Obviously ruport will be loaded :) Since the require "fastercsv" is within the DataSet.load method there is no reason why fastercsv should load at this point. It does not when I am not using gems. > With older versions of rubygems require time was proportional to the > number of gems installed (I don't know if this is still true). > > You probably want to run gem cleanup. Will try this but these are generally on machines that only have ruport and it's dependencies installed :-/