|
The installation of the RDoc is quite an easy task to do as it comes in the pacake form with Ruby.
We will now try to write our first basic ruby class in the documented form.
And then we will save the following as The_basic_documented_ruby_class.rb file.
# An example class class TheBasicDocumentedClass
$ rdoc The_basic_documented_ruby_class.rb
The_basic_documented_ruby_class.rb: c.
Generating HTML...
Files: 1
Classes: 1
Modules: 0
Methods: 1
Elapsed: 0.06s
And here it goes, we have got our ruby documentation done.
We will find that we have successfully created a doc directory which has an index.html file.
There are various Options which can be implemented on RDOC. Few of them are mentioned below with their brief functionality:
--all
By default, all the public methods are considered for the purpose of execution but if all is given it will take into account all the private methods and the protected methods.
--main name
This option is used to put the class or the file to be visible on the index page.
--exclude pattern
All the files and the directories which match exactly with the given pattern in this option is not considered for the purpose of execution and processing.
--quiet
As the option is self explanatory, if quiet is given all the messages which mention the progress will not be displayed.
--one-file
Giving this option will help to get all the output in just one file.
--opname name
This option will set the given output name.
--charset charset
Set the character set for the generated HTML.
--fmt fmt
This option will give the output in a given format.
--inline-source
If this option is not given then the source code of methods is displayed in a popup. By giving this option then the source code will be displayed inline.
--diagram
This option will be used to include the diagrams.
|