behavior of -rsomegem differs from require 'somegem'

J

Jeremy Hinegardner

I just encountered something today and I'm not sure if this should be
the expected behaviour. Most likely I'm doing something odd here. I
believe this only affects items require'd as gems.
ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-darwin8.9.1]
require 'rubygems'
require 'fastercsv'

puts $:.sort.join("\n")
 
L

Logan Capaldo

I just encountered something today and I'm not sure if this should be
the expected behaviour. Most likely I'm doing something odd here. I
believe this only affects items require'd as gems. [snip]
Is this the expected behaviour that -rsomegem behaves differently than
'require "somegem"'. Is the handling of -r different than 'require'
loading rubygems alters the Kernel#require method. -r doesn't actually
call Kernel#require, it directly invokes the underlying C function(s)
the method calls. Therefore, rubygems is incapable of changing the
behavior of -r.
 
J

Jeremy Hinegardner

I just encountered something today and I'm not sure if this should be
the expected behaviour. Most likely I'm doing something odd here. I
believe this only affects items require'd as gems. [snip]
Is this the expected behaviour that -rsomegem behaves differently than
'require "somegem"'. Is the handling of -r different than 'require'
loading rubygems alters the Kernel#require method. -r doesn't actually
call Kernel#require, it directly invokes the underlying C function(s)
the method calls. Therefore, rubygems is incapable of changing the
behavior of -r.

Thanks!

-r using the underlying C function(s). That's the clarification I
needed.


enjoy,

-jeremy
 

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

No members online now.

Forum statistics

Threads
473,781
Messages
2,569,615
Members
45,296
Latest member
HeikeHolli

Latest Threads

Top