How do I download a file over HTTP using Ruby?
Probably the shortest way to download a file:
require 'open-uri' download = open('http://example.com/download.pdf') IO.copy_stream(download, '~/my_file.pdf')