When I do
ruby-1.9.2-p180 :002 > Curl::Multi.download(["http://www.bbc.com"])
=> nil
The downloaded file is of zero size
ls -l
-rw-r--r-- 1 staff 0 Jan 5 19:51 www.bbc.com
But the same works with Curl::Easy.download
Curl::Easy.download("http://www.bbc.com")
=> #<Curl::Easy http://www.bbc.com>
ls -l
-rw-r--r-- 1 staff 111549 Jan 5 19:53 www.bbc.com
Am I missing something?
You're not - Curl::Multi.http
(and Curl::Multi.download
as well, since it actually calls Curl::Multi.http
) have been broken in Curb since version 0.7.15.
This totally baffled me for awhile but I figured out what was wrong and have submitted a patch (see https://github.com/taf2/curb/pull/115).
Hopefully this gets merged upstream - in the meantime, you should stick to Curb 0.7.14 and below.
UPDATE: My pull request has been merged: https://github.com/taf2/curb/commit/dceafcd931c4fb7ad2c8d356537358fd1286e4ae - you can grab curb/master
for the fix.