From 1dcb0b91d5d41632269c010f70626596fd8ed30b Mon Sep 17 00:00:00 2001 From: Curtis Rueden Date: Fri, 6 Sep 2013 15:14:09 -0500 Subject: [PATCH] Fix word ordering in CSV (and HTML) output The problem is that the options word order may not correspond to the words_by_date word order. So for safety, we extract the words directly from words_by_date rather than relying on the options values. --- lib/git_pissed/formats/csv.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/git_pissed/formats/csv.rb b/lib/git_pissed/formats/csv.rb index 651ae59..f662022 100644 --- a/lib/git_pissed/formats/csv.rb +++ b/lib/git_pissed/formats/csv.rb @@ -9,7 +9,7 @@ def formatted end def table - [["date", *options.words].join(',')].tap do |table| + [["date", *words_by_date[0][1].keys].join(',')].tap do |table| words_by_date.each do |date, words| table << [date, *words.values].join(',') end