From 4e667dde4910d966f0244532bbb7782f86b85e20 Mon Sep 17 00:00:00 2001 From: Chris Jaekl Date: Thu, 16 Feb 2023 00:33:15 -0500 Subject: [PATCH] (Minor report format update; include monthly totals column.) --- lib/report.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/report.rb b/lib/report.rb index 45a981f..0f53835 100644 --- a/lib/report.rb +++ b/lib/report.rb @@ -15,7 +15,7 @@ class Report totals = add_month(totals: totals, filename: filename) end - headers = ["Month"] + headers = ["Month", "Total"] routes = totals.keys.reject{|x| x.is_a? Symbol}.sort_by(&:to_i) headers.append(routes) @@ -24,12 +24,14 @@ class Report values = @monthly_totals[month] puts [ "#{values[:year]}-#{values[:month]}", + values[:sum].to_s, routes.map{|route| values[route] || ""}, ].flatten.join(";") end puts [ "TOTAL", + totals[:sum].to_s, routes.map{|route| totals[route] || ""}, ].flatten.join(";") end -- 2.39.2