Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
return value of require
Detlef Reichl
6/1/2009 9:51:00 PM
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
--
http://de...
1 Answer
Brian Candler
6/2/2009 8:11:00 AM
0
Detlef Reichl wrote:
> 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
>> require 'openssl'
=> true
>> require 'openssl'
=> false
>>
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.
--
Posted via
http://www.ruby-...
.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
return value of require
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password