Class: Applitools::UniversalServerDownloader

Inherits:
Object
  • Object
show all
Defined in:
lib/applitools/universal_sdk/universal_server_downloader.rb

Class Method Summary collapse

Class Method Details

.download(to) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/applitools/universal_sdk/universal_server_downloader.rb', line 11

def download(to)
  puts "[eyes-universal] Downloading Eyes universal server from #{full_url}"
  where = filepath(to)
  full_url.open {|cloud| File.binwrite(where, cloud.read) }
  if Digest::SHA256.file(where).to_s == expected_binary_sha
    FileUtils.chmod('+x', where)
    puts "[eyes-universal] Download complete. Server placed in #{where}"
  else
    puts "[eyes-universal] Download broken. Please try reinstall"
  end
end

.filepath(to) ⇒ Object



23
24
25
# File 'lib/applitools/universal_sdk/universal_server_downloader.rb', line 23

def filepath(to)
  File.expand_path(filename, to)
end