Gem question

If I want just the 'kernel' part of the 'extensions' library I normally do:
    require 'extensions/kernel'

If I use gems with:
    require 'rubygems'
what is the equivalent?
    require_gem 'extensions/kernel' #=> error: could not find rubygem
    require_gem 'extensions' # works, but loads more than I want??

Thanks.

Does the following do what you want?

  require 'rubygems'
  require 'extensions/kernel'

If that brings in "too much", then it is probably because the gem author for
the that gem specified an "autorequire" that is bringing in the extra stuff.
If that is the issue, I would report it as a problem to the gem author.

···

On Saturday 29 January 2005 04:40 pm, itsme213 wrote:

If I want just the 'kernel' part of the 'extensions' library I normally do:
    require 'extensions/kernel'

If I use gems with:
    require 'rubygems'
what is the equivalent?
    require_gem 'extensions/kernel' #=> error: could not find rubygem
    require_gem 'extensions' # works, but loads more than I want??

--
-- 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)

Does the following do what you want?

  require 'rubygems'
  require 'extensions/kernel'

Yes it does. Does this work different from require_gem?

Thanks.

Evidently :slight_smile:

With rubygems loaded, any require that fails to find a requested file will
cause rubygems to look for a gem that can provide the file. The gem
containing the file is "activated" and the file is loaded.

With require_gem, the gem is explicitly activated and (in addition), any
autorequire files specified by the gem author are loaded.

···

On Saturday 29 January 2005 07:59 pm, itsme213 wrote:

> Does the following do what you want?
>
> require 'rubygems'
> require 'extensions/kernel'

Yes it does. Does this work different from require_gem?

--
-- 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)