[Rubygems-developers] require_gem/autorequire vs require.

Eric Hodel drbrain at segment7.net
Tue May 31 03:05:17 EDT 2005


... From ruby-talk

On 29 May 2005, at 22:07, Navindra Umanee wrote:

> So no-one managed to get rid of the require_gem stuff yet?  :-)

During the hackfest Ryan and I talked with Jim about possibly  
removing require_gem and the autorequire feature from the gem spec in  
favor of something else (activate + regular require).

Currently, the behavior is something like this:

   require_gem 'RubyInline', '= 3.2.2'

Which adds RubyInline 3.2.2 to $LOAD_PATH and requires 'inline'.

Or just:

   require 'inline'

Which automatically finds RubyInline, adds it to $LOAD_PATH, and then  
requires 'inline'.

Instead, we could do this:

   activate 'RubyInline', '= 3.2.2'
   require 'inline'

activate would add RubyInline 3.2.2 to $LOAD_PATH, and require would  
just DTRT.

This would separate the idea of 'gems managing packages' from the  
loading of files.

I think it also would make more clear what the purpose of (as it is  
now named) 'require_gem' does.

-- 
Eric Hodel - drbrain at segment7.net - http://segment7.net
FEC2 57F1 D465 EB15 5D6E  7C11 332A 551C 796C 9F04



More information about the Rubygems-developers mailing list