Public Instance Methods

document(options)click to toggle source

Generates documentation or a coverage report depending upon the settings in
options.

options can be either an RDoc::Options instance or an array of strings
equivalent to the strings that would be passed on the command line like
%w[-q -o doc -t My\ Doc\ Title]. document will automatically call RDoc::Options#finish if an options
instance was given.

Return a list of the files to be processed in a directory. We know that
this directory doesn't have a .document file, so we're looking for
real files. However we may well contain subdirectories which must be tested
for .document files.

Given a list of files and directories, create a list of all the Ruby files
they contain.

If force_doc is true we always add the given files, if false,
only add files that we guarantee we can parse. It is true when looking at
files given on the command line, false when recursing through
subdirectories.

The effect of this is that if you want a file with a non-standard extension
parsed, you must name it explicitly.

# File rdoc/rdoc.rb, line 335defparse_filefilenameencoding = @options.encodingfilename = filename.encodeencoding@stats.add_filefilenamereturnifRDoc::Parser.binary?filenamecontent = RDoc::Encoding.read_filefilename, encodingreturnunlesscontentfilename_path = Pathname(filename).expand_pathbeginrelative_path = filename_path.relative_path_from@options.rootrescueArgumentErrorrelative_path = filename_pathendif@options.page_dirandrelative_path.to_s.start_with?@options.page_dir.to_sthenrelative_path =
relative_path.relative_path_from@options.page_direndtop_level = @store.add_filefilename, relative_path.to_sparser = RDoc::Parser.fortop_level, filename, content, @options, @statsreturnunlessparserparser.scan# restart documentation for the classes & modules foundtop_level.classes_or_modules.eachdo|cm|cm.done_documenting = falseendtop_levelrescueErrno::EACCES=>e$stderr.puts<<-EOFUnable to read #{filename}, #{e.message}
Please check the permissions for this file. Perhaps you do not have access to
it or perhaps the original author's permissions are to restrictive. If the
this is not your library please report a bug to the author.
EOFrescue=>e$stderr.puts<<-EOFBefore reporting this, could you check that the file you're documenting
has proper syntax:
#{Gem.ruby} -c #{filename}
RDoc is not a full Ruby parser and will fail when fed invalid ruby programs.
The internal error was:
\t(#{e.class}) #{e.message}
EOF$stderr.putse.backtrace.join("\n\t") if$DEBUG_RDOCraiseenilend

parse_files(files)click to toggle source

Parse each file on the command line, recursively entering directories.