nobu.nokada / softhome.net wrote:
> Hi,
>
> At Fri, 23 Sep 2005 01:46:40 +0900,
> Robert Klemme wrote in [ruby-talk:157135]:
>>> I'm using <http://www.rubyist.net/~nobu/ruby/netrc.rb>.
>>
>> "Internal Server Error" - Hm...
>
> Hmmm, I can't stop it from seeing .rb as CGI.  Try
> http://www.rubyist.net/~nobu/ruby/netrc_rb.txt

Thanks, I can see it now. Looks like you subclassed Hash. I will study your 
code more. Your parsing logic seems much more complex than mine; perhaps I'm 
missing something.

I note that your technique is similar to the Perl module in that you load 
the entire file into a hash. But this conflicts with the documentation in 
that once a matching "machine" entry is found or the "default" entry is 
found, parsing stops when the next "machine" or "default" entry (or eof) is 
found.

So if I have:

   machine foo ...
   default ...
   machine bar ...

ftp(1) will not see the "bar" entry (but instead would return the default 
login), while your code (and the Perl code) will return the "bar" entry.