Class: Fastlane::Helper::ConfigurationHelper
- Inherits:
-
Object
- Object
- Fastlane::Helper::ConfigurationHelper
- Defined in:
- lib/fastlane/plugin/dependency_check_ios_analyzer/helper/configuration_helper.rb
Class Method Summary collapse
Class Method Details
.clean_up(params) ⇒ Object
45 46 47 48 49 |
# File 'lib/fastlane/plugin/dependency_check_ios_analyzer/helper/configuration_helper.rb', line 45 def self.clean_up(params) return if params[:keep_binary_on_exit] FileUtils.rm_rf("#{params[:output_directory]}/dependency-check") end |
.install(params) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/fastlane/plugin/dependency_check_ios_analyzer/helper/configuration_helper.rb', line 10 def self.install(params) repo = 'https://github.com/jeremylong/DependencyCheck' name = 'dependency-check' base_url = "#{repo}/releases/download/v#{params[:cli_version]}/#{name}-#{params[:cli_version]}-release" bin_path = "#{params[:output_directory]}/#{name}/bin/#{name}.sh" zip_path = "#{params[:output_directory]}/#{name}.zip" unless File.exist?(bin_path) FileUtils.mkdir_p(params[:output_directory]) unless File.exist?(zip_path) zip_url = "#{base_url}.zip" UI.("🚀 Downloading DependencyCheck: #{zip_url}") curl = Curl.get(zip_url) { |curl| curl.follow_location = true } File.open(zip_path, 'w+') { |f| f.write(curl.body_str) } end unzip(file: zip_path, params: params) FileUtils.rm_rf(zip_path) end bin_path end |
.parse_output_types(output_types) ⇒ Object
35 36 37 38 39 40 41 42 43 |
# File 'lib/fastlane/plugin/dependency_check_ios_analyzer/helper/configuration_helper.rb', line 35 def self.parse_output_types(output_types) list = output_types.delete(' ').split(',') list << 'sarif' unless output_types =~ (/(sarif|all)/) report_types = '' list.each { |output_type| report_types += " --format #{output_type.upcase}" } UI.("🎥 Output types: #{list}") report_types end |