Skip to content

Commit 6d069ad

Browse files
committed
Import Rakefile from zzak/docs.ruby-lang.org
1 parent 4a3c58c commit 6d069ad

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

Rakefile

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
require 'rdoc/task'
2+
3+
versions = {
4+
"trunk" => "trunk",
5+
"2.0.0" => "ruby_2_0_0",
6+
"1.9.3" => "ruby_1_9_3",
7+
"1.8.7" => "ruby_1_8_7",
8+
}
9+
10+
versions.each do |version, branch_name|
11+
source_dir = "sources/#{version}"
12+
13+
directory source_dir do
14+
sh "git clone --depth=1 --branch=#{branch_name} git://github.com/ruby/ruby.git #{source_dir}"
15+
end
16+
17+
desc "Checks out source for #{version}"
18+
task "source:#{version}" => source_dir
19+
20+
desc "Updates source for #{version}"
21+
task "update:#{version}" => source_dir do
22+
Dir.chdir source_dir do
23+
sh "git pull origin #{branch_name}"
24+
end
25+
end
26+
27+
namespace :rdoc do
28+
lang_version = File.join("en", version)
29+
RDoc::Task.new(lang_version) do |rdoc|
30+
rdoc.title = "Documentation for Ruby #{version}"
31+
rdoc.main = "README"
32+
rdoc.rdoc_dir = version
33+
rdoc.rdoc_files << source_dir
34+
rdoc.options << "-U"
35+
rdoc.options << "--all"
36+
rdoc.options << "--root=#{source_dir}"
37+
rdoc.options << "--page-dir=#{source_dir}/doc"
38+
rdoc.options << "--encoding=UTF-8"
39+
end
40+
end
41+
task "rdoc:#{version}" => "update:#{version}"
42+
end
43+
44+
desc "Checks out sources for all versions"
45+
task "source" => versions.keys.map { |version| "source:#{version}" }
46+
47+
desc "Updates sources for all versions"
48+
task "update" => versions.keys.map { |version| "update:#{version}" }
49+
50+
desc "Build RDoc HTML files for all versions"
51+
task "rdoc" => versions.keys.map { |version| "rdoc:#{version}" }
52+

0 commit comments

Comments
 (0)