Ruby Gem for convenient reading and writing of CSV files. It has intelligent defaults, and auto-discovery of column and row separators. It imports CSV Files as Array(s) of Hashes, suitable for direct processing with ActiveRecord, kicking-off batch jobs with Sidekiq, parallel processing, or oploading data to S3. Writing CSV Files is equally easy.
0) Refactoring of Code and Tests
1) Performance Improvements
2) Previous versions of SmarterCSV applied some header transformations when
user_provided_headers
were provided.This legacy behavior does not make much sense, because when
user_provided_headers
are given, we can assume they are correct, and should be used as-is.For the unlikely scenario that incorrect
user_provided_headers
were given, the legacy code attempted to disambiguate them, by applying a suffix.3) Previously
strings_as_keys
transformations were applied touser_provided_headers
This legacy behavior does not make much sense, because when
user_provided_headers
are given, we can assume they are correct, and should be used as-is.BREAKING CHANGES:
when
user_provided_headers
are provided:strings_as_keys
options will be ignoredoption
duplicate_header_suffix
now defaults to''
instead ofnil
.nil
to get the behavior from previous versions.