module Dl def self.download(url) session = Patron::Session.new puts "Downloading #{url}..." response = session.get url filename = response.url.split('/').pop puts "Downloaded to file #{filename}!" File.new(filename, 'w').write(response.body) end end