-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
42 lines (34 loc) · 1.06 KB
/
Rakefile
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
40
41
42
require 'rubygems'
require 'rake'
def staticmatic(command)
require '.haml/lib/haml'
require 'staticmatic'
configuration = StaticMatic::Configuration.new
eval(File.read("src/configuration.rb"))
StaticMatic::Base.new(".", configuration).run(command)
end
desc "Build everything."
task :build => [:site, :yardoc]
desc "Use StaticMatic to build the site."
task(:site => :haml) {staticmatic "build"}
desc "Preview the site with StaticMatic."
task(:preview => :haml) {staticmatic "preview"}
desc "Build the YARD documentation."
task :yardoc => :haml do
require 'fileutils'
Dir.chdir(".haml") {sh %{rake doc ANALYTICS=UA-535380-9 YARD_TITLE="Haml Documentation"}}
FileUtils.mkdir_p("site/docs")
FileUtils.rm_rf("site/docs/yardoc")
FileUtils.mv(".haml/doc", "site/docs/yardoc")
end
task :haml => ".haml" do
Dir.chdir(".haml") do
sh %{git fetch}
sh %{git checkout origin/master}
end
end
file ".haml" do
sh %{git clone -l -s . .haml}
Dir.chdir(".haml") {sh %{git checkout origin/master}}
end
task(:default) {puts "Dummy default task for RunCodeRun"}