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)
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