Project

table_fu

0.01
No commit activity in last 3 years
No release in over 3 years
A library for manipulating tables as arrays
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0

Runtime

 Project Readme
# TableFu

TableFu turns a matric array(from a csv file for example) into a spreadsheet.

Allows formatting, macros, sorting, and faceting.

Documentation:
http://propublica.github.com/table-fu

Installation:
gem install table-fu


## Usage

    csv =<<-CSV
    Project,Cost,Date,URL
    Build Supercollider,500_000_000.50,09/15/2009,http://project.com
    Harness Power of Fusion,25_000_000,09/16/2009,http://project2.com
    Motorized Bar Stool,45.00,09/17/2009,http://project3.com
    CSV
    
    @spreadsheet = TableFu.new(csv) do |s|
      s.formatting = {'Cost' => 'currency',
                      'Link' => {'method'=> 'link', 'arguments' => ['Project', 'URL']}}
      s.sorted_by = {'Project' => {'order' => 'descending'}}
      s.columns = ['Date', 'Project', 'Cost', 'Link']
    end 

    @spreadsheet.rows[0].column_for('Cost').to_s #=> '$45.00'
    
    @spreadsheet.rows[0].columns[1].to_s #=> 'Motorized Bar Stool'
    
    @spreadsheet.rows[0].column_for('Link').to_s 
    #=> "<a href='http://project.com' title='Build Supercollider'>Build Supercollider</a>"