vendor/gems/rubyzip-0.9.1/lib/download_quizzes.rb
#
# Download a binary file from the rubyquiz url
#

Download a binary file from the rubyquiz url
Download a binary file from the rubyquiz url
def download(file, todir = '.')
  begin
    puts "Downloading file #{file} from #{@address}"
    c = open("http://#{@address}/#{file}").read
    Dir.mkdir(todir) if not File.directory?(todir)
    f = open("#{todir}/#{file}", 'wb')
    f.puts c
    f.close
  rescue => e
    if not File.exists?(fullfile)
      $stderr.puts "Could not download file #{file} form #{@address}."
      $stderr.puts e.to_s
    end
  end
end
def download ( file , todir = '.' ) begin puts "Downloading file #{file} from #{@address}" c = open ( "http://#{@address}/#{file}" ) . read Dir . mkdir ( todir ) if not File . directory? ( todir ) f = open ( "#{todir}/#{file}" , 'wb' ) f . puts c f . close rescue => e if not File . exists? ( fullfile ) $stderr . puts "Could not download file #{file} form #{@address}." $stderr . puts e . to_s end end end
Download a binary file from the rubyquiz url
Download a binary file from the rubyquiz url
file
<not_specific>
todir
<not_specific>