This method is deprecated or moved on the latest stable version.
The last existing version (v2_2_9) is shown here.
extract_comment(comment)
public
Extracts the comment for this section from the original comment block. If
the first line contains :section:, strip it and use the rest. Otherwise
remove lines up to the line containing :section:, and look for those lines
again at the end and remove them. This lets us write
# :section: The title# The body
# File lib/rdoc/context/section.rb, line 98
def extract_comment comment
case comment
when Array then
comment.map do |c|
extract_comment c
end
when nil
RDoc::Comment.new ''
when RDoc::Comment then
if comment.text =~ /^#[ \t]*:section:.*\n/ then
start = $`
rest = $'
comment.text = if start.empty? then
rest
else
rest.sub(/#{start.chomp}\Z/, '')
end
end
comment
when RDoc::Markup::Document then
comment
else
raise TypeError, "unknown comment #{comment.inspect}"
end
end