RubyGems New gem() Method


#1

Am I understanding right that the new gem() does not actually perform
the require? It just sets up version handling, right?

Does this work for something like the soap4r gem? You can’t require
that gem normally, because the standard library will take
precedence. In the past, require_gem() got around this but I’m
thinking we lost that trick.

Am I missing something?

James Edward G. II


#2

On Feb 27, 2007, at 14:52, James Edward G. II wrote:

Am I understanding right that the new gem() does not actually
perform the require? It just sets up version handling, right?

Kernel#gem adds the gem’s require_paths to $:.

Does this work for something like the soap4r gem? You can’t
require that gem normally, because the standard library will take
precedence. In the past, require_gem() got around this but I’m
thinking we lost that trick.

No, #gem doesn’t do autorequire. That’s the only difference.

Am I missing something?

Yes. Use #gem.


#3

On Feb 27, 2007, at 5:15 PM, Eric H. wrote:

On Feb 27, 2007, at 14:52, James Edward G. II wrote:

Am I understanding right that the new gem() does not actually
perform the require? It just sets up version handling, right?

Kernel#gem adds the gem’s require_paths to $:.

So gem prepends them to $:, so they will be found before the standard
libraries? Good to know.

James Edward G. II