-
Notifications
You must be signed in to change notification settings - Fork 8
/
Rakefile
37 lines (33 loc) · 891 Bytes
/
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
require "pathname"
projects = %w[
test-unit
test-unit-activesupport
test-unit-capybara
test-unit-notify
test-unit-rails
test-unit-rr
]
base_dir = Pathname(__FILE__).realpath.dirname.parent
publish_base = Pathname(__FILE__).realpath.dirname
desc "Update documents"
task :update do
projects.each do |project|
project_dir = base_dir + project
Dir.chdir(project_dir.to_path) do
sh "bundle", "exec", "rake", "reference:generate"
end
if project == "test-unit"
html_dir = project_dir + "doc/html"
sh "rsync -a #{html_dir}/ #{publish_base}/"
end
reference_dir = project_dir + "doc/reference"
publish_dir = publish_base + project
sh "rsync -a --delete #{reference_dir}/ #{publish_dir}/"
end
end
desc "Publish documents"
task :publish => :update do
sh "git", "add", "-u"
sh "git", "commit", "-m", "Update documents"
sh "git", "push"
end