From: Jim Weirich Date: 2004-11-21T13:40:47+09:00 Subject: Re: several questions on using gems On Saturday 20 November 2004 09:36 pm, David Garamond wrote: > but i wonder why rubygems doesn't hack Kernel#require to accept version > requirements as well. that way i can forget all about Kernel#require_gem require works at a file level. require_gem works at a package level. There is some confusion because (a) often packages often have the same name as their main require file, and (b) rubygems allows you to specify a special require file that is automatically required when the gem is loaded. The difference is important because they are used differently. Every file that uses (for example) the Builder::XmlMarkup class should include 'builder/xmlmarkup'. But the require_gem statement for builder should more centralized. This is because you don't want to scatter explicit version references throughout your code. It is better to keep them in one place (more or less). At least that's my current thinking on the topic. -- -- Jim Weirich jim@weirichhouse.org http://onestepback.org ----------------------------------------------------------------- "Beware of bugs in the above code; I have only proved it correct, not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)