agardiner/csv-diff

Broken on ruby 2.2.2

DanielHeath opened this issue · 4 comments

Parsing a csv now gives you a CSV::Row, which doesn't respond to +.

`'get_diff_fields': undefined method + for #CSV::Row:0x007f91dba5fe50 (NoMethodError).

Can you show me what arguments you are passing to CSVDiff.initialize?

git clone https://gist.github.com/015432bd43c5ad8d55e9.git should have a repro.

I've tested on the latest gem release, and master.

OK, I don't think this is anything to do with using Ruby 2.2.2; instead, by passing in the headers: true option to CSVDiff.new, you are instructing CSV to return CSV::Row objects instead of an Array.
If you omit this option, CSVDiff will assume the first row contains headers anyway.
I will also think about a fix to prevent the error with this usage, which is not at all unreasonable.