fastlane/lib/fastlane/actions/gcovr.rb in fastlane-2.74.1 vs fastlane/lib/fastlane/actions/gcovr.rb in fastlane-2.75.0.beta.20180109010003
- old
+ new
@@ -58,15 +58,15 @@
# The args we will build with
gcovr_args = nil
# Allows for a whole variety of configurations
- if params.kind_of? Hash
+ if params.kind_of?(Hash)
params_hash = params
# Check if an output path was given
- if params_hash.key? :output
+ if params_hash.key?(:output)
create_output_dir_if_not_exists(params_hash[:output])
end
# Maps parameter hash to CLI args
gcovr_args = params_hash_to_cli_args(params_hash)
@@ -78,18 +78,18 @@
gcovr_args = gcovr_args.join(" ")
command = "gcovr #{gcovr_args}"
UI.success("Generating code coverage.")
UI.verbose(command)
- Actions.sh command
+ Actions.sh(command)
end
def self.create_output_dir_if_not_exists(output_path)
output_dir = File.dirname(output_path)
# If the output directory doesn't exist, create it
- unless Dir.exist? output_dir
- FileUtils.mkpath output_dir
+ unless Dir.exist?(output_dir)
+ FileUtils.mkpath(output_dir)
end
end
def self.params_hash_to_cli_args(params)
# Remove nil value params