summaryrefslogtreecommitdiffstats
path: root/ruby/ffi-k8055/tasks/rdoc.rake
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2011-06-06 10:53:35 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2011-06-06 10:53:35 +0200
commit49e880da1dbab3850c4eb1682bafad6b57267817 (patch)
treef2bba3048b297189ef51fe304edbb4ec34736801 /ruby/ffi-k8055/tasks/rdoc.rake
parent5e0aad9befe6214134a77cb267b8c89596945109 (diff)
downloadk8055-49e880da1dbab3850c4eb1682bafad6b57267817.zip
k8055-49e880da1dbab3850c4eb1682bafad6b57267817.tar.gz
add ruby/ffi-k8055
Diffstat (limited to 'ruby/ffi-k8055/tasks/rdoc.rake')
-rw-r--r--ruby/ffi-k8055/tasks/rdoc.rake46
1 files changed, 46 insertions, 0 deletions
diff --git a/ruby/ffi-k8055/tasks/rdoc.rake b/ruby/ffi-k8055/tasks/rdoc.rake
new file mode 100644
index 0000000..71adf9a
--- /dev/null
+++ b/ruby/ffi-k8055/tasks/rdoc.rake
@@ -0,0 +1,46 @@
+# -*- coding: UTF-8 -*-
+#
+require 'rake/rdoctask'
+
+namespace :doc do
+ desc 'Generate RDoc documentation'
+ Rake::RDocTask.new do |rd|
+ rdoc = PROJ.rdoc
+ rd.main = rdoc.main
+ rd.rdoc_dir = rdoc.dir
+
+ incl = Regexp.new(rdoc.include.join('|'))
+ excl = Regexp.new(rdoc.exclude.join('|'))
+ files = PROJ.gem.files.find_all do |fn|
+ case fn
+ when excl; false
+ when incl; true
+ else false end
+ end
+ rd.rdoc_files.push(*files)
+ title = "#{PROJ.name}-#{PROJ.version} Documentation"
+ rf_name = PROJ.rubyforge.name
+ title = "#{rf_name}'s " + title if rf_name.valid? and rf_name != title
+ rd.options << "-t #{title}"
+ rd.options.concat(rdoc.opts)
+ end
+
+ desc 'Generate ri locally for testing'
+ task :ri => :clobber_ri do
+ sh "#{RDOC} --ri -o ri ."
+ end
+
+ task :clobber_ri do
+ rm_r 'ri' rescue nil
+ end
+end # namespace :doc
+
+desc 'Alias to doc:rdoc'
+task :doc => 'doc:rdoc'
+
+desc 'Remove all build products'
+task :clobber => %w(doc:clobber_rdoc doc:clobber_ri)
+
+remove_desc_for_task %w(doc:clobber_rdoc)
+
+# EOF