From 61276853312524649ee91d6d2ddb5bd4bd4b0ffd Mon Sep 17 00:00:00 2001 From: Peter B <33984+pbonnell@users.noreply.github.com> Date: Tue, 1 Nov 2022 09:58:09 -0700 Subject: [PATCH] Destructures csv_options for Ruby 3 https://github.com/agardiner/csv-diff/issues/17 --- lib/csv-diff/csv_source.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/csv-diff/csv_source.rb b/lib/csv-diff/csv_source.rb index faec38b..dfa71aa 100644 --- a/lib/csv-diff/csv_source.rb +++ b/lib/csv-diff/csv_source.rb @@ -57,7 +57,7 @@ def initialize(source, options = {}) @path = source # When you call CSV.open, it's best to pass in a block so that after it's yielded, # the underlying file handle is closed. Otherwise, you risk leaking the handle. - @data = CSV.open(@path, mode_string, csv_options) do |csv| + @data = CSV.open(@path, mode_string, **csv_options) do |csv| csv.readlines end elsif source.is_a?(Enumerable) && source.size == 0 || (source.size > 0 && source.first.is_a?(Enumerable))