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 “ruport” #depends on fastercsv, but should not load it at this
Ruport::DataSet.load(“foo.csv”) #now fastercsv should be loaded
This works fine when running via ruby -Ilib over my sources, but when
I use it as a gem, it autoloads all it’s deps, which takes between 3
and 5 seconds and is really annoying.
My Rakefile with gemspec is here: