[Rubygems-developers] autoload

Trans transfire at gmail.com
Sun Oct 28 23:11:56 EDT 2007


On 10/28/07, NAKAMURA, Hiroshi <nakahiro at sarion.co.jp> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
>
> Trans wrote:
> > 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'
>
> gem 'redcloth'
>
> >   autoload(:RedCloth, 'redcloth')
> >   p RedCloth
>
> > 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).
>
> Sure.  Why don't you ask this on ruby-core?

Yes, I would, except I no longer subscribe to that list -- I got tired
of being berated for not discussing "appropriate" ruby-core topic
every time I clicked send.

I'll mention on ruby-talk though.

T.


More information about the Rubygems-developers mailing list