require 'rubygems' require 'rake/clean' CLEAN.include(['tmp', 'crash.log', '.bundle']) task :default => [ :gen ] desc "Compile the website templates into a static site" task :gen do Rake::Task[:download_codebase].invoke system 'nanoc compile' Rake::Task[:clean].invoke end desc "Run the website locally. View at http://localhost:3000" task :run do system 'nanoc view' end desc "Watch content folder for changes and autogen the site" task :dev do system 'nanoc autocompile' end desc "Download the Apache Thrift codebase to update documentation with" task :download_codebase do tmp_dir = File.join(File.dirname(__FILE__), "tmp") src_dir = File.join(tmp_dir, "trunk") unless File.exist?(src_dir) puts "Cloning Apache Thrift codebase" FileUtils.mkdir_p(tmp_dir) system("git clone --depth 1 http://git-wip-us.apache.org/repos/asf/thrift.git #{src_dir}") end end