This method is deprecated or moved on the latest stable version.
The last existing version (v2_2_9) is shown here.
include_file(name, indent, encoding)
public
Handles the :include: filename directive.
If the first line of the included file starts with ‘#’, and contains an
encoding information in the form ‘coding:’ or ‘coding=’, it is
removed.
If all lines in the included file start with a ‘#’, this leading
‘#’ is removed before inclusion. The included content is indented like
the :include: directive.
# File lib/rdoc/markup/pre_process.rb, line 257
def include_file name, indent, encoding
full_name = find_include_file name
unless full_name then
warn "Couldn't find file to include '#{name}' from #{@input_file_name}"
return ''
end
content = RDoc::Encoding.read_file full_name, encoding, true
# strip magic comment
content = content.sub(/\A# .*coding[=:].*$/, '').lstrip
# strip leading '#'s, but only if all lines start with them
if content =~ /^[^#]/ then
content.gsub(/^/, indent)
else
content.gsub(/^#?/, indent)
end
end