From: Gavin Sinclair Date: 2004-08-18T00:33:23+09:00 Subject: Re: Recursive install-stub for gems? On Wednesday, August 18, 2004, 1:27:59 AM, Richard wrote: >>> I guess if your library was a random collection of a series of >>> separate files that could individually be required or not, then >>> stubbing every one would make some sense. >> >> That _is_ the case in one of my libraries, but I reckon that's not >> often the case. >> >> It does happen reasonably often, though, that a library has several >> potential 'require' targets, some of which will never be loaded unless >> you ask for them. Rake's not a good example, because it's more an app >> that a library, but it's all that comes to mind at the moment: >> >> require 'rake' >> require 'rake/packagetask' >> require 'rake/rdoctask' >> # etc. > Right...and what is cool is if the stub is 'rake' then doing: > require 'rake' > Will move the rake gem into the LOAD_PATH so subsequent: > require 'rake/packagetask' > require 'rake/rdoctask' > Just works, because rakes libs are now fully available (no stubs needed). Good point. Then there's just the corner case, where someone goes require 'rake/packagetask' thinking that "require 'rake'" is implicit in that, and getting a surprise. That's where the ability to stub lots of files is useful. And if the package author chooses which files to stub, instead of doing them all, it conveys to the user which files are "interesting". Gavin