Check this out:
if I run the below code on Windows, Shoes eventually gives me a
"SocketError: Hostname not known":
#!shoes
require 'net/http'
Shoes.app{
para "Net::HTTP gives: "
begin
para Net::HTTP.get
URI.parse('http://ambiboots.audio.s3.amazonaws.com/etienne/test.txt')
rescue => e
para e.inspect
end
}
Then, the first time I ran the below code (on Windows), the download
version works .... but the Net::HTTP one doesn't!
I ran it again, and both worked.
then I ran just the net:http version, and it didn't work again.
#!shoes
require 'net/http'
Shoes.app{
para "Net::HTTP gives: "
begin
para Net::HTTP.get
URI.parse('http://ambiboots.audio.s3.amazonaws.com/etienne/test.txt')
rescue => e
para e.inspect
end
para "download gives: "
begin
download "http://ambiboots.audio.s3.amazonaws.com/etienne/test.txt"
do |content|
para content.response.body
end
rescue => e
para e.inspect
end
}
By itself, the download method works fine and fast everytime.
......... there's gotta be a difference with how net:http resolves
stuff and download ... maybe its some locking thing (_why has talked
about net::http locking stuff).
problem is .... download:headers are broken in raisins (otherwise I
could just use that).
Etienne