Bob Showalter
1/5/2006 9:41:00 PM
Brian Buckley wrote:
> Hello all,
>
> What does the return value of a require statement supposed to indicate?
> My
> understanding was that 'true' meant the required library got properly
> loaded.
>
> When I open a new IRB session and type, say, "require 'builder'" I get a
> false returned.
>
> require 'builder''
> => false
>
> However, it appears that the statement does in fact load the library
> (the
> new classes in the library become available, etc). Why is the statement
> returning false (or how can I diagnose why) and is it something to be
> concerned over?
A false return means the file was already in $", and so wasn't loaded
again. I'm guessing that some earlier require'd file has already brought
in builder.rb
If the file can't be found, and exception is raised.