require "bundler/gem_tasks" require "rack" require "RedCloth" require "redcloth-formatters-rdoc" require "rdoc/task" require 'rspec/core/rake_task' RSpec::Core::RakeTask.new(:spec) do |rspec| rspec.rspec_opts = "-f d", "--color" end task :default => :spec desc "Create and open documentation" task :doc do # Compile the readme to the rdoc format readme_textile = File.open('README.textile', 'r+'){ |file| file.read } readme_rdoc = RedCloth.new(readme_textile).to_rdoc File.open('README.rdoc', 'w+'){ |file| file.write(readme_rdoc) } # Create rdoc with the readme as main file `rdoc --main README.rdoc --include lib/bigbench/help/` RDoc::Task.new do |rdoc| rdoc.main = "README.rdoc" rdoc.rdoc_files.include("README.rdoc", "lib/bigbench/help/") end # Fix RDocs inability to handle tables index_html = File.open('doc/index.html', 'r+'){ |file| file.read } index_html.gsub! '<', '<' index_html.gsub! '>', '>' index_html.gsub! '