This method is deprecated or moved on the latest stable version.
The last existing version (v2_2_9) is shown here.
truncate(text)
public
Truncates text at the end of the first word after the
character_limit.
# File lib/rdoc/markup/to_html_snippet.rb, line 269
def truncate text
length = text.length
characters = @characters
@characters += length
return text if @characters < @character_limit
remaining = @character_limit - characters
text =~ /\A(.{#{remaining},}?)(\s|$)/ # TODO word-break instead of \s?
$1
end