lib/dl/dl.rb in dl-0.0.3 vs lib/dl/dl.rb in dl-0.1.0
- old
+ new
@@ -1,10 +1,14 @@
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