Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept csv generate options hash #61

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alessandro-fazzi
Copy link

@alessandro-fazzi alessandro-fazzi commented Mar 22, 2023

Problem

As far as I understood, it's not possible to configure how the csv file will be generated.

My personal use case is to be able to export a CSV with custom column separator.

Proposal

Introduce a new option called csv_generate_options; this is a Hash. This will be passed down to the CSV.generate call, thus accepted options are the same as ones accepted by the CSV class.

Here's the ref: https://ruby-doc.org/3.2.1/stdlibs/csv/CSV.html#class-CSV-label-Options+for+Generating

The option will be configurable as other options are:

  • csv_generate_options parameter passed to .to_csv method
  • SPREADSHEET_OPTIONS global config
  • SpreadsheetArchitect.default_options global config

@alessandro-fazzi
Copy link
Author

This PR is a draft ATM because:

  • i'd like to know if maintainer(s) would be interested to introduce the feature
  • the implementation is not yet tested

@westonganger
Copy link
Owner

Yes I like this idea. Carry on!

@alessandro-fazzi
Copy link
Author

Yes I like this idea. Carry on!

Thanks for your feedback. Will understand how to test the feature and I'll un-draft the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants