Skip to content

Commit

Permalink
Fix word ordering in CSV (and HTML) output
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ctrueden committed Sep 6, 2013
1 parent 2e6d3ce commit 1dcb0b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/git_pissed/formats/csv.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1dcb0b9

Please sign in to comment.