summaryrefslogtreecommitdiff
path: root/rake_tasks/documentation.rake
diff options
context:
space:
mode:
authormurphy <murphy@rubychan.de>2010-03-31 22:17:06 +0000
committermurphy <murphy@rubychan.de>2010-03-31 22:17:06 +0000
commit862bc9aa6b002f6b29cf74f93ca66e63cf370819 (patch)
tree45e8a8731fadca8df5fe86595dc2e8f6dc7a3782 /rake_tasks/documentation.rake
parentcce5dad0dce285a2b7c4f1fe0ec79d10c71a8403 (diff)
downloadcoderay-862bc9aa6b002f6b29cf74f93ca66e63cf370819.tar.gz
Upporting changes from 0.9.2 (vs. 0.9.1).
Diffstat (limited to 'rake_tasks/documentation.rake')
-rw-r--r--rake_tasks/documentation.rake26
1 files changed, 9 insertions, 17 deletions
diff --git a/rake_tasks/documentation.rake b/rake_tasks/documentation.rake
index 9a96a02..162699d 100644
--- a/rake_tasks/documentation.rake
+++ b/rake_tasks/documentation.rake
@@ -1,24 +1,16 @@
-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
+desc 'Generate documentation for CodeRay'
+Rake::RDocTask.new :doc do |rd|
rd.main = 'lib/README'
- rd.title = "CodeRay Documentation"
+ rd.title = 'CodeRay Documentation'
+
rd.options << '--line-numbers' << '--inline-source' << '--tab-width' << '2'
rd.options << '--fmt' << ENV.fetch('format', 'html_coderay')
- # rd.options << '--all'
+ require 'pathname'
+ template = File.join ROOT, 'rake_helpers', 'coderay_rdoc_template.rb'
+ rd.template = Pathname.new(template).expand_path.to_s
- rd.template = ENV.fetch('template', CODERAY_TEMPLATE)
- rd.rdoc_files.add(*EXTRA_FILES.in(ROOT))
- rd.rdoc_files.add(*Dir[File.join(LIB_ROOT, 'coderay', '**', '*.rb')])
- rd.rdoc_files.add(*Dir[File.join(LIB_ROOT, '*.rb')])
-end
-
-desc 'Generate documentation for CodeRay'
-Rake::RDocTask.new :doc do |rd|
- set_rdoc_info rd
+ rd.rdoc_files.add EXTRA_RDOC_FILES
+ rd.rdoc_files.add Dir['lib']
rd.rdoc_dir = 'doc'
end