-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathRakefile
69 lines (57 loc) · 1.67 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
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
68
69
# -*- ruby -*-
require "pathname"
base_dir = Pathname(__FILE__).dirname.expand_path
test_unit_dir = (base_dir.parent + "test-unit").expand_path
test_unit_lib_dir = test_unit_dir + "lib"
lib_dir = base_dir + "lib"
$LOAD_PATH.unshift(test_unit_lib_dir.to_s)
$LOAD_PATH.unshift(lib_dir.to_s)
require "test/unit/notify"
require "yard"
require "packnga"
require "rubygems"
require "bundler/gem_helper"
helper = Bundler::GemHelper.new(base_dir)
def helper.version_tag
version
end
helper.install
spec = helper.gemspec
version = spec.version
Packnga::DocumentTask.new(spec) do |task|
task.original_language = "en"
task.translate_language = "ja"
end
release_task = nil
Packnga::ReleaseTask.new(spec) do |task|
release_task = task
task.index_html_dir = "../../www/test-unit.github.io"
end
doc_dir = base_dir + "doc"
reference_dir = doc_dir + "reference"
reference_screenshot_dir = reference_dir + "screenshot"
namespace :doc do
directory reference_screenshot_dir.to_s
task :screenshot => reference_screenshot_dir.to_s do
(base_dir + "screenshot").children.each do |file|
next if file.directory?
cp(file.to_s, reference_screenshot_dir.to_s)
end
end
end
task :yard => "doc:screenshot"
namespace :release do
namespace :references do
namespace :upload do
index_html_dir = release_task.instance_variable_get(:@index_html_dir)
index_html_dir = Pathname.new(index_html_dir)
upload_dir = index_html_dir + spec.name
directory upload_dir.to_s
task :screenshot => ["doc:screenshot", upload_dir.to_s] do
cp_r(reference_screenshot_dir.to_s, upload_dir.to_s)
end
end
task :upload => "upload:screenshot"
end
end
# vim: syntax=Ruby