Module: SeleniumPrep::Downloader

Extended by:
Downloader
Includes:
URLs
Included in:
Downloader
Defined in:
lib/selenium-prep/downloader.rb

Constant Summary

Constants included from URLs

URLs::BASE_URL, URLs::DRIVERS, URLs::SERVER

Instance Method Summary collapse

Instance Method Details

#downloadObject



13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/selenium-prep/downloader.rb', line 13

def download
  ConfigChecker.new

  urls.each do |url|
    download_target = file_for url
    File.open(download_target, 'wb') do |file|
      puts "[ #{Time.now} ]   Downloading #{download_target}"
      file.write(RestClient.get(url))
      puts "[ #{Time.now} ]   Finished downloading #{download_target}"
    end
  end

end