Dave Thomas has coded an addition to Rdoc that makes it easy for code to emit sections of rdoc text. From his post on ruby-talk:
Basically, if the main program file in your application has an RDoc comment describing the program, you can use it to generate a usage message for your users by calling
RDoc::usage( )
If you just want to display the Synopsis section (which in the RDoc will have a heading "= Synopsis"), you'd instead say
RDoc::usage('synopsis')
To display the author and copyright sections, you'd say
RDoc::usage('author', 'copyright')
RDoc::usage is in the head of Ruby 1.9 and 1.8 CVS right now.