Class: TYCiCore::TYDownload

Inherits:
Object
  • Object
show all
Defined in:
lib/tuya/ci/core/download.rb

Class Method Summary collapse

Class Method Details

.download(url, name, path = './') ⇒ Object



3
4
5
6
7
8
9
# File 'lib/tuya/ci/core/download.rb', line 3

def self.download(url, name, path='./')
	puts "Start download : #{url}"
	data=open(url){|f|f.read}
	puts "Saving #{path}#{name}"
	open("#{path}#{name}","wb"){|f|f.write(data)}
	FileUtils.pwd << "/#{name}"
end