Sha256: 4790e83f2a72eef60b5a334ae1975f251af90e778df636e0508e721fdb697f23
Contents?: true
Size: 338 Bytes
Versions: 15
Compression:
Stored size: 338 Bytes
Contents
require 'net/http' module Net def self.download(url) Net::HTTP.get_response(URI.parse(url)) end def self.download_and_save(url,path = nil) if path.nil? path = File.expand_path(url.split('/').last) else path = File.expand_path(path) end open(path,'w') { |file| file.write(download(url)) } end end
Version data entries
15 entries across 15 versions & 1 rubygems