RubyGems New gem() Method

  • Thread starter James Edward Gray II
  • Start date
J

James Edward Gray II

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 Gray II
 
E

Eric Hodel

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.
 
J

James Edward Gray II

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 Gray II
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,234
Messages
2,571,180
Members
47,813
Latest member
RustyGary3

Latest Threads

Top