Michael Neumann
1/18/2005 2:56:00 PM
Jamis Buck wrote:
> On 22:04 Tue 18 Jan , Michael Neumann wrote:
>
>>Hi there,
>>
>>I just read the Web-testing thread in the latest "Ruby Weekly News" and want
>>to tell the interested people that I hacked up a little library which I use
>>in some small projects. Web::Unit didn't work for my purposes, and it was
>>easier to reinvent the wheel than to hack Web::Unit (of course I first tried
>>to hack it...).
>>
>>It depends on narf-lib (>= 0.6.3) more exactly, it's version of htmltools, and
>>requires Ruby-current (due to limitations in the net/http library of 1.8.2).
>
>
> Isn't 1.8.2 the current Ruby? Or does "Ruby-current" mean something
> other than what I'm understanding it to mean?
With -current I mean the development version of Ruby. Sorry for the
confusion. Maybe this could get back-ported into the stable-trunk?
>>If you want to try it out with Ruby 1.8.2, just get the net/*.rb files from
>>Ruby-current and use these instead (or use local overrides:
>>$LOAD_PATH.unshift './net-overrides' ... ).
>>
>>Features:
>> * Cookies (very preliminary, no expire etc.)
>> * automatic redirect
>> * Forms, Links
>>
>
>
> [snip]
>
>
>>I've realized that Ruby has client libraries for www/http (cgi.rb, net/http)
>>and server libraries for http (webrick), but not a common library that puts
>>those things together...
>
>
> Nice job, Michael. I'm looking forward to trying this one out.
Well, just download the net/ directory from the development branch of
Ruby, and put it into a net-overrides directory (you only need
net/http.rb, net/https.rb and net/protocol.rb). Then modify mechanize.rb:
# put this at the top of mechanize.rb
$LOAD_PATH.unshift "./net-overrides"
This should then work with Ruby 1.8.2.
Regards,
Michael