From 30e6751efed7eac2e223e59ce044b955a3ea7c42 Mon Sep 17 00:00:00 2001 From: Matt Fenelon Date: Wed, 4 May 2022 17:00:19 +0100 Subject: [PATCH] Fix instance variable not initialized warning When `report_with_single_file` is true, reading from `single_report_path` without calling `single_report_path=` causes ruby to issue a warning: warning: instance variable @single_report_path not initialized Fixes the warning by initialising the `@single_report_path` instance variable with the default. --- lib/simple_cov_lcov/configuration.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/simple_cov_lcov/configuration.rb b/lib/simple_cov_lcov/configuration.rb index fc6eb0b..2b3cfe7 100644 --- a/lib/simple_cov_lcov/configuration.rb +++ b/lib/simple_cov_lcov/configuration.rb @@ -18,7 +18,7 @@ def single_report_path=(new_path) end def single_report_path - @single_report_path || File.join(output_directory, lcov_file_name) + @single_report_path ||= File.join(output_directory, lcov_file_name) end def lcov_file_name