[Rubygems-developers] autoload

Trans transfire at gmail.com
Sun Oct 28 13:29:36 EDT 2007


I just discovered an interesting problem with overriding
Kernel#require. Because RUbyGems does this it is likewise effected.

Make sure you 'redcloth' installed via the gem and then try this:

  require 'rubygems'
  require 'redcloth'
  p RedCloth

Works fine. Now this:

  require 'rubygems'
  autoload(:RedCloth, 'redcloth')
  p RedCloth

And I get:

  no such file to load -- redcloth (LoadError)

It fails to find redcloth; apparently b/c the autoload trigger is
using it's own require code and not any of the overridable methods
(I've tried Kernel.require, Kernel#require and the load methods for
that matter).

Hopefully I've missed something, and there is a simple remedy to this.

T.

7rans <transfire at gmail.com>
BE HELP: http://manumission.info


More information about the Rubygems-developers mailing list