return value of require

D

Detlef Reichl

Hi,

I had a problem with require and ruby 1.8.7-p72 on debian (original
debian packages).

For some of the ruby-gnome2 libraries (all, which are based on gtk),
require returned false. Beside of the return value all works like
expected.

With an upgrade to 1.8.7-p160 and compiling ruby from source, all
libraries return true on require, as expected.

Can someone tell me, in which version this change was made?

Cheers, detlef
 
B

Brian Candler

Detlef said:
I had a problem with require and ruby 1.8.7-p72 on debian (original
debian packages).

For some of the ruby-gnome2 libraries (all, which are based on gtk),
require returned false. Beside of the return value all works like
expected.

With an upgrade to 1.8.7-p160 and compiling ruby from source, all
libraries return true on require, as expected.

Can someone tell me, in which version this change was made?

I'm don't see what the problem is. require returns false if the library
has already been loaded, and true if it is loaded for the first time at
that point.

$ irb --simple-prompt
If some of the ruby-gnome2 libraries returned false, it's probably just
because some previous library that you required in turn required those
other libraries.

If you want to investigate further,

puts $LOADED_FEATURES

will probably be of help.

Regards,

Brian.
 

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,172
Messages
2,570,934
Members
47,478
Latest member
ReginaldVi

Latest Threads

Top