Skip to content

Commit 1f1e5a7

Browse files
committed
Document RDoc::RI::Task
Clean up task names
1 parent 1a46d96 commit 1f1e5a7

File tree

1 file changed

+51
-6
lines changed

1 file changed

+51
-6
lines changed

lib/rdoc/ri/task.rb

Lines changed: 51 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,66 @@
66

77
require 'rdoc/task'
88

9+
##
10+
# RDoc::RI::Task creates ri data in <code>./.rdoc</code> for your project.
11+
#
12+
# It contains the following tasks:
13+
#
14+
# [ri]
15+
# Build ri data
16+
#
17+
# [clobber_ri]
18+
# Delete ri data files. This target is automatically added to the main
19+
# clobber target.
20+
#
21+
# [reri]
22+
# Rebuild the ri data from scratch even if they are not out of date.
23+
#
24+
# Simple example:
25+
#
26+
# require 'rdoc/ri/task'
27+
#
28+
# RDoc::RI::Task.new do |ri|
29+
# ri.main = 'README.rdoc'
30+
# ri.rdoc_files.include 'README.rdoc', 'lib/**/*.rb'
31+
# end
32+
#
33+
# For further configuration details see RDoc::Task.
34+
935
class RDoc::RI::Task < RDoc::Task
10-
def clobber_task_description
11-
"Remove RDoc RI data files"
36+
37+
DEFAULT_NAMES = { # :nodoc:
38+
:clobber_rdoc => :clobber_ri,
39+
:rdoc => :ri,
40+
:rerdoc => :reri,
41+
}
42+
43+
##
44+
# Create an ri task with the given name. See RDoc::Task for documentation on
45+
# setting names.
46+
47+
def initialize name = DEFAULT_NAMES # :yield: self
48+
super
1249
end
1350

51+
def clobber_task_description # :nodoc:
52+
"Remove RI data files"
53+
end
54+
55+
##
56+
# Sets default task values
57+
1458
def defaults
1559
super
60+
1661
@rdoc_dir = '.rdoc'
1762
end
1863

19-
def rdoc_task_description
20-
'Build RDoc RI data files'
64+
def rdoc_task_description # :nodoc:
65+
'Build RI data files'
2166
end
2267

23-
def rerdoc_task_description
24-
'Rebuild RDoc RI data files'
68+
def rerdoc_task_description # :nodoc:
69+
'Rebuild RI data files'
2570
end
2671
end

0 commit comments

Comments
 (0)