Skip to content

ishakir/scrambly-csv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Code Climate

Scrambly CSV

Ever got fed up with your users using bad practises to read your CSV files? I certainly have! This library will fix all those problems by writing CSV files in a way that ensures bet practices on the part of the reader. Whoever said people know what's best for them, eh?

Installation

Add this line to your application's Gemfile:

gem 'scrambly-csv'

And then execute:

$ bundle

Or install it yourself as:

$ gem install scrambly-csv

Usage

file = Tempfile.new('foo')
  CSV.open(file.path, 'wb') do |csv|
    writer = ScramblyCsv::Scrambly.new(csv, ["one", "two", "three", "four"])
    writer.write([1, 2, 3, 4])
    writer.write([5, 6, 7, 8])
    writer.write([9, 10, 11, 12])
  end
puts file.path 

Contributing

There are other features that need to implemented to save people from themselves:

  1. Ensure that users can't just split on comma (difficult!)
  2. Randomly quote some elements but not others
  3. Add random escape charaters

In order to contribute:

  1. Fork it ( https://github.com/ishakir/scrambly-csv/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

About

A CSV Writer that ensures best practises!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages