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