rODF
This is (soon to be) a RubyGem for writing to ODF output. It currently supports creating spreadsheets.
This is NOT an ODF reading library.
Installation
At some moment you’ll be able to
sudo gem install rodf
But for the time being, try going to the project’s GitHub page and downloading the source: github.com/thiagoarrais/rodf/tree
How do I use it?
rODF works pretty much like Builder, but with ODF-aware constructs. Try this:
require 'odf/spreadsheet'
ODF::SpreadSheet.file("my-spreadsheet.ods") do |spreadsheet|
spreadsheet.table 'My first table from Ruby' do |table|
table.row {|row| row.cell 'Hello, rODF world!' }
end
end
Some basic formatting is also possible:
require 'odf/spreadsheet'
ODF::SpreadSheet.file("my-spreadsheet.ods") do |spreadsheet|
spreadsheet.style 'red-cell', :family => :cell do |style|
style.property :text, 'font-weight' => 'bold', 'color' => '#ff0000'
end
spreadsheet.table 'Red text table' do |table|
table.row {|row| row.cell 'Red', :style => 'red-cell' }
end
end