Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Use Google Spreadsheets as your CMS
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test
.document
.gitignore
Gemfile
Gemfile.lock
LICENSE.txt
README.rdoc
Rakefile
VERSION
tablespoon.gemspec

README.rdoc

tablespoon

Access Google Spreadsheets in a vaguely record-like way.

Requirements

  • Google Spreadsheet that is organized like a database table. Fieldnames in the first row, records in the rest of the rows.

Installation

sudo gem install tablespoon

How to Use

require 'rubygems'
require 'tablespoon'

Connect to a Google doc

doc   = Tablespoon::Doc.new( "0ArhhvPZdTe-WdGpZQ3pEY1hDcEUxWmxwNnJEQ3g4aVE", 
                         :username => google_username, :password => google_password )

Get a worksheet either by name or by id. (Coming soon: Optionally, declare an id field so you can find rows by id later.)

rows = doc.get_table 'Sheet1', :id_field => 'last-name'

Loop thru rows and retrieve data

rows.each do |r|
  puts r['full-name']    
end

Modify fields and save data back to the spreadsheet.

rows.each do |r|
  r['full-name'] = r['full-name'].upcase
end

Copyright

Copyright © 2013 Matt Ericson. See LICENSE.txt for further details.

Something went wrong with that request. Please try again.