----- Original Message ----- 
From: "Ged Byrne" <gedb01 / yahoo.co.uk>
To: "ruby-talk ML" <ruby-talk / ruby-lang.org>
Sent: Friday, August 15, 2003 11:19 AM
Subject: Re: Help with IO Code


> Wow, you guys are fast!
> 
> Thanks.  I'll have this cracked in no time.
> 
> What API Referenece would you recommend?  The
> one-click installation comes with the "programming"
> book.

That's probably still the best online reference.

You need "ri" if you don't have it -- it's a 
command-line based reference tool (also by 
Dave Thomas).

Not sure if it's bundled with 1.8, though if not,
it should be IMO. If you can't find it, it is
probably on rubycentral.com or rubygarden.org --
not sure where it "lives." Hopefully it's even
in the RAA.

I also have an (out of date) page "Ruby I/O at
a Glance" on rubyhacker.com if you want to look 
at that.

Hal


>  --- "Hal E. Fulton" <hal9000 / hypermetrics.com> wrote:
> > ----- Original Message ----- 
> > From: "Ged Byrne" <gedb01 / yahoo.co.uk>
> > To: "ruby-talk ML" <ruby-talk / ruby-lang.org>
> > Sent: Friday, August 15, 2003 9:53 AM
> > Subject: Help with IO Code
> > 
> > 
> > > I'm working through "Programming Ruby - The
> > Pragmatic
> > > Programmer's Guide" and all has been joy and
> > pleasure.
> > >  Now, however, I'm in difficulty.
> > > 
> > > From the IO chapter I'm running the following
> > example:
> > > 
> > > require 'net/http'
> > > 
> > > h = Net::HTTP.new('www.pragmaticprogrammer.com',
> > 80)
> > > resp, data = h.get('/index.html', nil)
> > > puts resp.message #I added this
> > > puts data #And this
> > > if resp.message == "OK" 
> > >   #Spam assasin didn't like the Img tag in the re.
> > >   data.scan(/###/) { |x| puts x }
> > > end
> > > 
> > > 
> > > The result I'm getting is:
> > > 
> > > OK
> > > nil
> > > listimgs.rb:8: private method `scan' called for
> > nil
> > > (NoMethodError)
> > 
> > That's an issue with the net/http code changing...
> > but I thought it had been resolved and a
> > "compatibility"
> > fix had been added.
> > 
> > Suggest you search ruby-talk.org for messages in the
> > last 2-3 months about net/http -- if you can't find 
> > the relevant ones, I'll assist.
> > 
> > Hal
> > 
> >  
> 
> ________________________________________________________________________
> Want to chat instantly with your online friends?  Get the FREE Yahoo!
> Messenger http://uk.messenger.yahoo.com/
>