From a949e6fc8990f0fbbfed649b51d465c300899e0a Mon Sep 17 00:00:00 2001 From: Valerie Mettler Date: Wed, 29 Jun 2022 12:52:02 -0700 Subject: [PATCH] Fix Ruby 3 syntax errors --- lib/bulk_processor/stream_encoder.rb | 2 +- lib/bulk_processor/validated_csv.rb | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/bulk_processor/stream_encoder.rb b/lib/bulk_processor/stream_encoder.rb index febb81d..2d4ebec 100644 --- a/lib/bulk_processor/stream_encoder.rb +++ b/lib/bulk_processor/stream_encoder.rb @@ -16,7 +16,7 @@ def initialize(stream) # # @return [String] a UTF-8 encoded string def encoded - stream.read.encode(Encoding::UTF_8, ENCODING_OPTIONS) + stream.read.encode(Encoding::UTF_8, **ENCODING_OPTIONS) end private diff --git a/lib/bulk_processor/validated_csv.rb b/lib/bulk_processor/validated_csv.rb index 43febbd..ac6f95f 100644 --- a/lib/bulk_processor/validated_csv.rb +++ b/lib/bulk_processor/validated_csv.rb @@ -44,7 +44,6 @@ def valid? if csv.headers.any? { |header| header.nil? || header.strip == '' } errors << MISSING_COLUMN_MESSAGE end - errors.empty? end @@ -54,7 +53,7 @@ def valid? def csv return @csv if instance_variable_defined?('@csv') - @csv = CSV.parse(stream, PARSING_OPTIONS) + @csv = CSV.parse(stream, **PARSING_OPTIONS) rescue NoMethodError => error if error.message == BAD_HEADERS_ERROR_MSG errors << MISSING_COLUMN_MESSAGE