agardiner/csv-diff

Exclude filter parameter is not being utilized because the attribute name is incorrect.

hammzj opened this issue · 4 comments

Issue Location

@exclued = options[:exclude]

Compare to

exclude_filter = convert_filter(@exclude, @field_names)
end
@line_count = 0
@skip_count = 0
@dup_count = 0
line_num = 0
@data.each do |row|
line_num += 1
next if line_num == 1 && @field_names && @ignore_header
unless @field_names
if row.class.name == 'CSV::Row'
@field_names = row.headers.each_with_index.map{ |f, i| f || i.to_s }
else
@field_names = row.each_with_index.map{ |f, i| f || i.to_s }
end
index_fields
include_filter = convert_filter(@include, @field_names)
exclude_filter = convert_filter(@exclude, @field_names)


Everywhere else in the file, @exclude is being used but it comes up empty because it's never been declared.
Please make this correction to allow the exclusion filter to be utilized again.

@agardiner I can do this for you and issue a PR once I make the change, if you'd prefer.

Thanks for catching this. Typo fixed in #0f646f.

I see it. Will you need to push a gem version 0.6.1 for this? Still showing as 0.6.0 on the master branch and I did not get an update on my machine when I pulled it from our company's gem server (which updates daily).

Version 0.6.1 has now been pushed to rubygems.