Skip to content

FabricioFFC/to_worksheet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ToWorksheet

Generate a worksheet from an array.

Installation

gem install to_worksheet

Example

  require 'rubygems'
  require 'to_worksheet'

  my_array = [['apple', 1], ['orange', 0.5], ['pineapple', 2], ['watermelon', 3]]
  worksheet = my_array.to_worksheet(:header => ['fruit', 'price'], :name => 'Price List')

  file  = File.new("/tmp/worksheet.xls", "w")
  file.puts worksheet
  file.close

Maintainers

How to collaborate

If you would collaborate, you can create a fork, apply the modification and submit a pull request :)