Class: Registration::Downloader

Inherits:
Object
  • Object
show all
Extended by:
Yast::Logger
Defined in:
src/lib/registration/downloader.rb

Overview

HTTP/HTTPS download support TODO: move it to yast2 to share it

Class Method Summary collapse

Class Method Details

.download(file_url, insecure: false) ⇒ String

download a remote file via HTTP or HTTPS protocol, if maximum nuber or redirects is reached the download fails with RuntimeError exception

Parameters:

  • file_url (String, URI)

    URL of the file to download

  • insecure (Boolean) (defaults to: false)

    if true the SSL verification errors are ignored

Returns:

  • (String)

    the contents of the downloaded file


43
44
45
# File 'src/lib/registration/downloader.rb', line 43

def self.download(file_url, insecure: false)
  download_file(file_url, insecure: insecure)
end