require 'rake' require 'fileutils' directory “examples”
def get_base(f)
f.sub(File.dirname(__FILE__)+"/../examples/","").gsub("/","_").gsub(".rb","")
end
EXAMPLES=Dir.glob(File.dirname(__FILE__)+“/../examples /*.rb”).map {|v| [v, get_base(v)] }.find_all{|v| !v.include?“_data”}
EXAMPLES_BASE=EXAMPLES.map {|v| v}
desc “Build all html, rtf and pdf files” task :build_site do
ruby "build_site.rb"
end
task :clean do
Dir.glob(File.dirname(__FILE__)+"/examples/*.pdf").each do |t| FileUtils.rm t end Dir.glob(File.dirname(__FILE__)+"/examples/*.html").each do |t| FileUtils.rm t end Dir.glob(File.dirname(__FILE__)+"/examples/*.rtf").each do |t| FileUtils.rm t end Dir.glob(File.dirname(__FILE__)+"/examples/images/*.*").each do |t| FileUtils.rm t end
end
load 'upload_task.rb' if File.exists? “upload_task.rb”