blob: ab09c462a30ed75e7bfd0a9f81533fa6863b946c (
plain)
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
|
require 'rake/rdoctask'
require 'pathname'
CODERAY_TEMPLATE = Pathname.new(File.dirname(__FILE__)).join('..', 'rake_helpers', 'coderay_rdoc_template.rb').expand_path.to_s
def set_rdoc_info rd, small = false
rd.main = 'README'
rd.title = "CodeRay Documentation"
rd.options << '--line-numbers' << '--inline-source' << '--tab-width' << '2'
# rd.options << '--format' << ENV.fetch('format', 'html_coderay')
rd.options << '--all'
rd.template = ENV.fetch('template', CODERAY_TEMPLATE)
rd.rdoc_files.add *EXTRA_FILES.in(ROOT)
rd.rdoc_files.add *Dir[File.join(LIB_ROOT, "#{'**/' unless small}*.rb")]
end
namespace :doc do
desc 'Generate documentation for CodeRay'
Rake::RDocTask.new :all do |rd|
set_rdoc_info rd
rd.rdoc_dir = 'doc/all'
end
desc 'Generate test documentation for CodeRay (faster)'
Rake::RDocTask.new :small do |rd|
set_rdoc_info rd, true
rd.rdoc_dir = 'doc/small'
end
desc 'Upload rdoc to ' + FTP_DOMAIN
task :upload => :all do
gn 'Uploading documentation:'
Dir.chdir 'doc/all' do
cYcnus_ftp do |ftp|
uploader = uploader_for ftp
ftp.chdir FTP_CODERAY_DIR
ftp.chdir 'doc'
Dir['**/*.*'].each &uploader
end
end
gn 'Documentation uploaded.'
end
end
task :doc => 'doc:all'
|