Skip to content

Commit

Permalink
rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
tilo committed Sep 20, 2023
1 parent f805914 commit c9f8fb0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/smarter_csv.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
require_relative "extensions/hash"
require_relative "smarter_csv/version"

require_relative "smarter_csv/smarter_csv" unless ENV['CI'] # does not compile/link in CI?
# require 'smarter_csv.bundle' unless ENV['CI'] # local testing
# require_relative "smarter_csv/smarter_csv" unless ENV['CI'] # does not compile/link in CI?
require 'smarter_csv.bundle' unless ENV['CI'] # local testing

module SmarterCSV
class SmarterCSVException < StandardError; end
Expand Down Expand Up @@ -370,10 +370,10 @@ def blank?(value)
true

when Array
value.empty? || value.inject(true){|result, x| result &&= elem_blank?(x)}
value.empty? || value.inject(true){|result, x| result && elem_blank?(x)}

when Hash
value.empty? || value.values.inject(true){|result, x| result &&= elem_blank?(x)}
value.empty? || value.values.inject(true){|result, x| result && elem_blank?(x)}

else
false
Expand Down Expand Up @@ -530,7 +530,7 @@ def process_headers(filehandle, options)
missing_keys -= options[:silence_missing_keys] if options[:silence_missing_keys].is_a?(Array)

unless missing_keys.empty? || options[:silence_missing_keys] == true
raise SmarterCSV::KeyMappingError, "ERROR: can not map headers: #{missing_keys.join(', ')}"
raise SmarterCSV::KeyMappingError, "ERROR: can not map headers: #{missing_keys.join(', ')}"
end

headerA.map!{|x| key_mappingH.has_key?(x) ? (key_mappingH[x].nil? ? nil : key_mappingH[x]) : (options[:remove_unmapped_keys] ? nil : x)}
Expand Down

0 comments on commit c9f8fb0

Please sign in to comment.