I am under the impression that Kernel#require returns false if the
argument is already loaded. However, this morning I encountered
behavior that confused me.
I was trying to require the RedCloth gem, and I was doing it via irb.
First I tried:
irb(main):001:0> require 'redcloth'
LoadError: no such file to load -- redcloth
from (irb):1:in `require'
from (irb):1
but that didn't work because the gems were not loaded (at least I
think that's why I got an error). So, instead I did this:
So then I noticed that the last call to require returned false, which
made me think that requiring 'rubygems' was all that I needed to do
and RedCloth would automatically be loaded. I tested this by
restarting irb, but my assumption proved incorrect:
Can somebody help me understand why the RedCloth constant was not
initialized yet the call to require returns false? I hope I've
included enough information.
Incidentally, if I follow the instructions from the Pickaxe I get an error:
irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require_gem 'redcloth'
Gem::LoadError: Could not find RubyGem redcloth (> 0.0.0)
Thanks for any input!
mr.ra88it
$ ruby -v
ruby 1.8.4 (2005-12-24) [powerpc-darwin8.3.0]
Oi, the Titanic of my ramble is getting ready to hit a iceberg. But, here goes: in a locale AND context where case distinction isn't semantically significant or actually helpful. Like programming language libraries named in languages using the latin alphabet and using capital letters for reasons of historical conventions rather than to disambiguate the meaning of words *pant*. Unless someone tells me what would come from having distinct "redcloth" and "RedCloth" libs aside from sadistically enjoying the torment of people that confuse them.
Another example: filesystem filename lookup. </troll> *dons his +5 Asbestos Plate Mail, +80% flame resistance, and prepares to duck objects thrown at him*
David Vallner
···
On Fri, 13 Jan 2006 23:03:35 +0100, <mental@rydia.net> wrote:
Quoting David Vallner <david@vallner.net>:
Three hoolays for systems that aren't arbitrarily case-sensitive.
On 1/13/06, David Vallner <david@vallner.net> wrote:
On Fri, 13 Jan 2006 23:03:35 +0100, <mental@rydia.net> wrote:
> Quoting David Vallner <david@vallner.net>:
>
>> Three hoolays for systems that aren't arbitrarily case-sensitive.
>
> In which locale's notion of case?
>
> -mental
>
Oi, the Titanic of my ramble is getting ready to hit a iceberg. But, here
goes: in a locale AND context where case distinction isn't semantically
significant or actually helpful. Like programming language libraries named
in languages using the latin alphabet and using capital letters for
reasons of historical conventions rather than to disambiguate the meaning
of words *pant*. Unless someone tells me what would come from having
distinct "redcloth" and "RedCloth" libs aside from sadistically enjoying
the torment of people that confuse them.
Another example: filesystem filename lookup. </troll> *dons his +5
Asbestos Plate Mail, +80% flame resistance, and prepares to duck objects
thrown at him*
David Vallner
--
-
'There was an owl lived in an oak.
The more he heard, the less he spoke.
The less he spoke, the more he heard.'