require 'csv' module Eco class CSV < ::CSV class << self # @return [Eco::CSV::Table] def parse(data, **kargs, &block) kargs = {headers: true, skip_blanks: true}.merge(kargs) Eco::CSV::Table.new(super(data, **kargs, &block)) end # @return [Eco::CSV::Table] def read(file, **kargs) kargs = {headers: true, skip_blanks: true}.merge(kargs) args = [file].tap do |arg| encoding = Eco::API::Common::Session::FileManager.encoding(file) arg.push("rb:bom|utf-8") if encoding == "bom" end Eco::CSV::Table.new(super(*args, **kargs)) end end end end require_relative 'csv/table'