C'est très simple, il suffit de créer un fichier Rakefile et de mettre:
# Generate the RDoc --------------------------------
Rake::RDocTask.new { |rdoc|
rdoc.rdoc_dir = 'doc'
rdoc.title = project_title
rdoc.options << '--line-numbers' << '--inline-source' << '-A cattr_accessor=object'
rdoc.rdoc_files.include('README', 'CHANGELOG')
rdoc.rdoc_files.include('lib/**/*.rb')
rdoc.rdoc_files.include('examples/**/*.rb')
}
Les fichiers README et CHANGELOG sont importants mais simple à faire... (il suffit de suivre la
syntaxe de RDoc).
Voilà 2 exemples de ce qu'on peut mettre dedans:
README
== Google Calendar
The Google Calendar project provides
* Export features (text file, simple html page or excel files),
* Ruby api's to connect to google calendars
* A plugin for Ruby On Rails.
== License
GoogleCalendar for Ruby is released under the Apache license.
== Support
http://rubyforge.org/projects/googlecalendar/
== Author
Benjamin Francisoud - http://rubyscube.blogspot.com
CHANGELOG
= Versions
=== 0.0.2 (June 16th, 2006)
* Refactor googlecalendar to a single rb file
* Add Rakefile
* Add Gem, Zip, Tar packaging
* Add RDoc
=== 0.0.1 (Mai 11th, 2006)
* Started project
= About Versioning
* Version number: major.minor.build
* Compatible release (increment the build number)
* Backward compatible, new feature release (increment minor number)
* Backward incompatible release (increment the major number)
Finallement, le plus important, il suffit de lancer la commande:
>rake rdoc et hop plein de jolies pages html de doc api référence ;)