Gust
Gust allows you to load many objects from an excel spreadsheet (.xls only) into Ruby objects.
objects = Gust.load('/path/to/spreadsheet.xls')
... and you're off!
Installation
Add this line to your application's Gemfile:
gem 'rb-gust'
And then execute:
$ bundle
Or install it yourself as:
$ gem install rb-gust
Usage
Gust requires that you format your spreadsheet correctly:
- first row with content as the object titles.
- second row has column headers
- third row begins the object data values
To load the objects into Ruby, use Gust.load()
. An RSpec example:
objects = Gust.load('/gust_gem_path/spec/worksheets/basic_objects.xls')
objects.vehicles.should eq(
[
{:name=>"sedan", :wheels=>4.0, :color=>"blue"},
{:name=>"sports car", :wheels=>4.0, :color=>"red"},
{:name=>"moving truck", :wheels=>6.0, :color=>"white"},
]
)
Contributing
Check out the feature forecast for desired features.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request