1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Import RDoc 3.1

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
drbrain 2010-12-28 22:08:56 +00:00
parent 90d5bcf910
commit e2efe8e81d
28 changed files with 494 additions and 56 deletions

View file

@ -240,6 +240,32 @@ class RDoc::Options
@title ||= string
end
##
# Returns a properly-space list of generators and their descriptions.
def generator_descriptions
lengths = []
generators = RDoc::RDoc::GENERATORS.map do |name, generator|
lengths << name.length
description = generator::DESCRIPTION if
generator.const_defined? :DESCRIPTION
[name, description]
end
longest = lengths.max
generators.sort.map do |name, description|
if description then
" %-*s - %s" % [longest, name, description]
else
" #{name}"
end
end.join "\n"
end
##
# Parse command line options.
@ -274,8 +300,9 @@ Usage: #{opt.program_name} [options] [names...]
will make rdoc show hashes in method links by default. Command-line options
always will override those in RDOCOPT.
- Darkfish creates frameless HTML output by Michael Granger.
- ri creates ri data files
Available formatters:
#{generator_descriptions}
RDoc understands the following file formats: