Introducing the indydoc gem
require 'indydoc'
idoc = IndyDoc.new
idoc.parse('/home/james/learning/ruby/temp/simple_number.rb')
puts idoc.to_px
The indydoc gem which is under development is intended to make documenting source code easier, by creating a template outline from the project's defined methods. This template which is a Polyrex file can be used to contain the descriptions, usage examples and comments. The Polyrex file will then be merged with the original source code file to create a well documented source code file.
output
<?xml version="1.0"?>
<doc>
<summary>
<project>project1</project>
<desc> </desc>
</summary>
<records>
<klass>
<summary>
<name>SimpleNumber</name>
</summary>
<records>
<def>
<summary>
<name>initialize</name>
<scope>private</scope>
<desc> </desc>
</summary>
<records/>
</def>
<def>
<summary>
<name>add</name>
<scope>public</scope>
<desc> </desc>
</summary>
<records/>
</def>
<def>
<summary>
<name>multiply</name>
<scope>public</scope>
<desc> </desc>
</summary>
<records/>
</def>
<def>
<summary>
<name>divide</name>
<scope>private</scope>
<desc> </desc>
</summary>
<records/>
</def>
<def>
<summary>
<name>square</name>
<scope>protected</scope>
<desc> </desc>
</summary>
<records/>
</def>
</records>
</klass>
</records>
</doc>
Resources
indydoc gem documentation generator