Skip to content
This repository
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 23 lines (20 sloc) 0.585 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
# encoding: UTF-8
require 'rubygems'
require 'bundler/gem_tasks'

require 'rake'
require 'rdoc/task'
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec)

task :env do
  $: << File.expand_path('lib', File.dirname(__FILE__))
  require 'to_spreadsheet'
  include ToSpreadsheet::Helpers
end

desc 'Generate a simple xlsx file'
task :write_test_xlsx => :env do
  require 'haml'
  path = '/tmp/spreadsheet.xlsx'
  html = Haml::Engine.new(File.read('spec/support/table.html.haml')).render
  ToSpreadsheet::Renderer.to_package(html).serialize(path)
  puts "Written to #{path}"
end
Something went wrong with that request. Please try again.