module Dl def self.download(url, raw = false) session = Patron::Session.new output "Downloading #{url}..." response = session.get url if raw == true puts response.body else filename = response.url.split('/').pop output "Downloaded to file #{filename}!" File.new(filename, 'w').write(response.body) end end private def self.output(string) puts string unless Dl::be_quiet == true end end