From c655ef8847eb4c08f89648491369f328615e935b Mon Sep 17 00:00:00 2001 From: mw Date: Thu, 19 Oct 2023 17:08:56 -0400 Subject: [PATCH] cosmetic & ensure --- lib/reports/shared_print_phase_count.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/reports/shared_print_phase_count.rb b/lib/reports/shared_print_phase_count.rb index cccbf059..8d07ded1 100644 --- a/lib/reports/shared_print_phase_count.rb +++ b/lib/reports/shared_print_phase_count.rb @@ -9,6 +9,8 @@ class SharedPrintPhaseCount attr_reader :phase, :finder, :output def initialize(phase: SharedPrint::Phases.list.max) @phase = phase.to_i + # Potentially use Reports::Dynamic instead of SharedPrint::Finder + # (but SP::Finder does the trick just fine for now) @finder = SharedPrint::Finder.new(phase: [@phase]) @output = Utils::ReportOutput.new("sp_phase#{@phase}_count") end @@ -29,6 +31,7 @@ def run handle.puts [org, phase, organization_tally[org]].join("\t") end puts "Finished writing to #{output.file}" + ensure handle.close end