I am trying to create a file loader with RubyGem Curb. (See This Question .)
I am trying to upload a zip file and then with a class file. I am trying to make a file so that I can double-click it in Finder (I'm on OS X). How am I going to convert this body "Curl'ed" to a zip file.
require 'rubygems' require 'curb' class Download def start curl = Curl::Easy.new('http://wordpress.org/latest.zip') curl.perform curl.on_body { |d| f = File.new('test.zip', 'w') {|f| f.write d} } end end dl = Download.new dl.start
I am not getting any error and I cannot find the file. I tried absolute paths no difference.
source share