forked from pieter/gitx
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRakefile
More file actions
67 lines (56 loc) · 1.83 KB
/
Rakefile
File metadata and controls
67 lines (56 loc) · 1.83 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
require 'fileutils'
require 'erb'
task :generate => [:generate_usermanual] do
require 'rdiscount'
require 'lib/release_notes'
`rm -rf output`
FileUtils.mkdir("output")
`cat text/*.markdown > output/UserManual.markdown`
`cp -r assets/* output`
template = ERB.new(File.read("templates/site.html"))
Dir.glob("text/*.markdown").each do |file|
contents = File.read(file)
@body = Markdown.new(ERB.new(contents).result(binding)).to_html
@filename = File.basename(file).gsub(/markdown$/,"html")
File.open("output/" + @filename, "w") do |f|
f.puts template.result(binding)
end
end
# Add the user manual
FileUtils.mkdir("output/images/UserManual")
`cp -r UserManual/output/images/* output/images/UserManual`
@filename = 'user_manual.html'
@body = File.read("UserManual/output/UserManual.html")
@title = "User Manual"
File.open("output/user_manual.html", "w") do |f|
f.puts template.result(binding)
end
`open output/index.html`
end
task :generate_usermanual do
require 'rdiscount'
`rm -rf UserManual/output`
FileUtils.mkdir("UserManual/output")
`cat UserManual/text/*.markdown > output/UserManual.markdown`
`cp -r UserManual/assets/images UserManual/output`
source = Dir.glob("UserManual/text/**/*.markdown").map do |file|
File.read(file)
end.join("\n")
body = Markdown.new(source).to_html
File.open("UserManual/output/UserManual.html", "w") do |f|
f.puts body
end
end
task :generate_appcast do
require 'lib/release_notes.rb'
require 'rdiscount'
FileUtils.mkdir_p("output/Downloads")
template = ERB.new(File.read("templates/sparkle.xml"))
filename = ENV["STABLE"] ? "appcast.xml" : "appcast_DEBUG.xml"
File.open("output/Downloads/#{filename}", "w") do |f|
f.puts template.result(binding)
end
end
task :upload do
`rsync -a output/ sydney:public_html/gitx/`
end