summaryrefslogtreecommitdiff
path: root/rake_tasks/documentation.rake
diff options
context:
space:
mode:
authormurphy <murphy@rubychan.de>2006-04-16 00:38:38 +0000
committermurphy <murphy@rubychan.de>2006-04-16 00:38:38 +0000
commitee808b400543d924286eebaee8ed1ad8a4e28ced (patch)
tree3aa0bf9eaa9aa328979d06c49a2f6bb03c7af5af /rake_tasks/documentation.rake
parent915a4ade8840f076b2ad2681944ab845ef038f0c (diff)
downloadcoderay-ee808b400543d924286eebaee8ed1ad8a4e28ced.tar.gz
Rake tasks completely redone.
rdoctask2.rb deleted; issues were fixed as of Rake 0.7.0.
Diffstat (limited to 'rake_tasks/documentation.rake')
-rw-r--r--rake_tasks/documentation.rake44
1 files changed, 44 insertions, 0 deletions
diff --git a/rake_tasks/documentation.rake b/rake_tasks/documentation.rake
new file mode 100644
index 0000000..21232b3
--- /dev/null
+++ b/rake_tasks/documentation.rake
@@ -0,0 +1,44 @@
+require 'rake/rdoctask'
+
+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 << '--fmt' << ENV.fetch('format', 'html_coderay')
+ rd.options << '--all'
+ rd.template = ENV.fetch('template', 'rake_helpers/coderay_rdoc_template.rb')
+ 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 'rdoc' 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'