Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 40 lines (29 sloc) 0.88 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
# -*- ruby -*-
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[0].include?"_data"}

EXAMPLES_BASE=EXAMPLES.map {|v| v[1]}


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"
Something went wrong with that request. Please try again.