Method: BuildVu#download_result

Defined in:
lib/buildvu.rb

#download_result(results, output_file_path, file_name = nil) ⇒ Object

Downloads the zip file produced by the microservice. Provide ‘.’ as the output_file_path if you wish to use the current directory. Will use the filename of the zip on the server if none is specified. Params:

output_file_path

string, the output location to save the zip file

file_name

string, (optional) the custom name for the zip file. This should not include .zip



84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/buildvu.rb', line 84

def download_result(results, output_file_path, file_name=nil)
  download_url = results['downloadUrl']

  raise('Error: downloadUrl parameter is empty') if download_url.nil?

  if file_name.nil?
    output_file_path += '/' + download_url.split('/').last
  else
    output_file_path += '/' + file_name + '.zip'
  end

  download download_url, output_file_path
end