On 21 Aug 2009, at 14:34, Jim Weirich wrote:

I know some work was put into making require 'rubygems' as lightweight as possible, so I was a little surprised to find that requiring rubygems into my program will also load any gem plugins that might be defined. I thought the plugins were for the gem command, not for general rubygems usage.

1.9?


Demonstration:

$ irb
irb(main):001:0> URL
NameError: uninitialized constant URL
        from (irb):1
irb(main):002:0> require 'rubygems'
=> true
irb(main):003:0> URL
=> "http://gemcutter.org";

URL is defined in the gemcutter gem's gem plugin so that's a good indication that gems plugins are loaded with require rubygems.

(And yes, I consider a top level, non-namespaced constant to be a bug and have submitted a patch to gemcutter to fix that).

Comments. Is this intended, or something that slipped through the cracks.

--
-- Jim Weirich
-- jim.weir...@gmail.com

_______________________________________________
Rubygems-developers mailing list
http://rubyforge.org/projects/rubygems
Rubygems-developers@rubyforge.org
http://rubyforge.org/mailman/listinfo/rubygems-developers

_______________________________________________
Rubygems-developers mailing list
http://rubyforge.org/projects/rubygems
Rubygems-developers@rubyforge.org
http://rubyforge.org/mailman/listinfo/rubygems-developers

Reply via email to