lib/dl/dl.rb in dl-1.1.0 vs lib/dl/dl.rb in dl-1.2.0
- old
+ new
@@ -8,10 +8,14 @@
if raw == true
puts response.body
else
- filename = response.url.split('/').pop
+ if Dl::file != nil
+ filename = Dl::file
+ else
+ filename = response.url.split('/').pop
+ end
output "Downloaded to file #{filename}!"
File.new(filename, 'w').write(response.body)
end
end