Permalink
Browse files

Added initial Rakefile

  • Loading branch information...
clbustos committed Jan 22, 2011
1 parent c91275c commit 07182ffa8d3b532307cc4eb50405a2b63a87fe64
Showing with 40 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +39 −0 web/Rakefile
View
@@ -6,3 +6,4 @@ doc
.yardoc
examples/images/*
examples/*.html
+web/upload_task.rb
View
@@ -0,0 +1,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"

0 comments on commit 07182ff

Please sign in to comment.