summaryrefslogtreecommitdiff
path: root/jni/ruby/lib/rdoc/ri/task.rb
diff options
context:
space:
mode:
authorJari Vetoniemi <jari.vetoniemi@indooratlas.com>2020-03-16 18:49:26 +0900
committerJari Vetoniemi <jari.vetoniemi@indooratlas.com>2020-03-30 00:39:06 +0900
commitfcbf63e62c627deae76c1b8cb8c0876c536ed811 (patch)
tree64cb17de3f41a2b6fef2368028fbd00349946994 /jni/ruby/lib/rdoc/ri/task.rb
Fresh start
Diffstat (limited to 'jni/ruby/lib/rdoc/ri/task.rb')
-rw-r--r--jni/ruby/lib/rdoc/ri/task.rb71
1 files changed, 71 insertions, 0 deletions
diff --git a/jni/ruby/lib/rdoc/ri/task.rb b/jni/ruby/lib/rdoc/ri/task.rb
new file mode 100644
index 0000000..e545d4a
--- /dev/null
+++ b/jni/ruby/lib/rdoc/ri/task.rb
@@ -0,0 +1,71 @@
+require 'rubygems'
+begin
+ gem 'rdoc'
+rescue Gem::LoadError
+end unless defined?(RDoc)
+
+require 'rdoc/task'
+
+##
+# RDoc::RI::Task creates ri data in <code>./.rdoc</code> for your project.
+#
+# It contains the following tasks:
+#
+# [ri]
+# Build ri data
+#
+# [clobber_ri]
+# Delete ri data files. This target is automatically added to the main
+# clobber target.
+#
+# [reri]
+# Rebuild the ri data from scratch even if they are not out of date.
+#
+# Simple example:
+#
+# require 'rdoc/ri/task'
+#
+# RDoc::RI::Task.new do |ri|
+# ri.main = 'README.rdoc'
+# ri.rdoc_files.include 'README.rdoc', 'lib/**/*.rb'
+# end
+#
+# For further configuration details see RDoc::Task.
+
+class RDoc::RI::Task < RDoc::Task
+
+ DEFAULT_NAMES = { # :nodoc:
+ :clobber_rdoc => :clobber_ri,
+ :rdoc => :ri,
+ :rerdoc => :reri,
+ }
+
+ ##
+ # Create an ri task with the given name. See RDoc::Task for documentation on
+ # setting names.
+
+ def initialize name = DEFAULT_NAMES # :yield: self
+ super
+ end
+
+ def clobber_task_description # :nodoc:
+ "Remove RI data files"
+ end
+
+ ##
+ # Sets default task values
+
+ def defaults
+ super
+
+ @rdoc_dir = '.rdoc'
+ end
+
+ def rdoc_task_description # :nodoc:
+ 'Build RI data files'
+ end
+
+ def rerdoc_task_description # :nodoc:
+ 'Rebuild RI data files'
+ end
+end