README.md in active_report-2.3.0 vs README.md in active_report-3.0.0

- old
+ new

@@ -1,19 +1,19 @@ # ActiveReport [![Gem Version](https://badge.fury.io/rb/active_report.svg)](http://badge.fury.io/rb/active_report) [![Build Status](https://travis-ci.org/drexed/active_report.svg?branch=master)](https://travis-ci.org/drexed/active_report) -[![Coverage Status](https://coveralls.io/repos/drexed/active_report/badge.png)](https://coveralls.io/r/drexed/active_report) +[![Coverage Status](https://coveralls.io/repos/github/drexed/active_report/badge.svg?branch=master)](https://coveralls.io/github/drexed/active_report?branch=master) ActiveReport is a library to export CSV's out of arrays, hashes, and records and vice versa. ## Installation Add this line to your application's Gemfile: ```ruby -gem 'active_report' +gem "active_report" ``` And then execute: $ bundle @@ -22,14 +22,31 @@ $ gem install active_report ## Table of Contents +* [Configuration](#configuration) * [Array](#array) * [Hash](#hash) * [Record](#record) +* [Evaluate](#evaluate) +## Configuration + +`rails g active_report:install` will generate the following `active_report.rb` file: + +```ruby +# config/initalizers/active_report.rb + +ActiveReport.configure do |config| + # option = default + + config.force_encoding = true + config.options = { encoding: "UTF-8" } +end +``` + ## Array **Export:** Convert an array or array of arrays to a CSV. **Options:** @@ -125,12 +142,22 @@ ```ruby ActiveReport::Record.import("sample.csv", model: User) ActiveReport::Record.import("sample.csv", model: User, except: :completed, headers: ["ID", "Task"], options: { col_sep: ";" }) ``` +## Evaluate + +**Array/Hash:** Convert the import of a array or hash to proper ruby objects. + +```ruby +ActiveReport::Hash.evaluate.import("sample.csv") +``` + ## Contributing -1. Fork it ( https://github.com/[my-github-username]/active_report/fork ) +Your contribution is welcome. + +1. Fork it 2. Create your feature branch (`git checkout -b my-new-feature`) -3. Commit your changes (`git commit -am 'Add some feature'`) +3. Commit your changes (`git commit -am 'Added some feature'`) 4. Push to the branch (`git push origin my-new-feature`) -5. Create a new Pull Request \ No newline at end of file +5. Create new Pull Request