Last active
August 29, 2015 14:17
-
-
Save randomutterings/ca004a732c66fe90c342 to your computer and use it in GitHub Desktop.
Google Sheets with roo and roo-google
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'roo-google' | |
# Setup your key and credentials | |
key = "googleSheetsUniqueId" | |
user = "user@domain.com" | |
password = "mysupersecretpassword" | |
gsheet = Roo::Google.new(key, user: user, password: password) | |
rows = gsheet.first_row..gsheet.last_row | |
columns = gsheet.first_column..gsheet.last_column | |
# iterate over each row in the spreadsheet | |
rows.each do |row| | |
columns.each do |column| | |
puts "Value at [#{row},#{column}] is: #{gsheet.cell(row, column)}" | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem 'roo', github: 'roo-rb/roo' | |
gem 'roo-google', github: 'roo-rb/roo-google' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment