I have a number of classes that are dynamically generated at the time my
extension is loaded. Is there an easy way to get rdoc to generate
documentation for these classes? It doesn't seem to do anything by
default.
One solution I know of is to generate the .c file statically (so instead
of generating the classes using a loop in C, I generate C code using a
loop in Ruby). I'd rather not go this route unless I have to.
Also, does a similar solution exist for pure ruby code?
Paul
If you're writing in 'C', and if you know the names ofthe classes you're generating, you can use
/*
* Document-class: DynamicClass
···
On Jul 19, 2004, at 9:38, Paul Brannan wrote:
I have a number of classes that are dynamically generated at the time my
extension is loaded. Is there an easy way to get rdoc to generate
documentation for these classes? It doesn't seem to do anything by
default.
One solution I know of is to generate the .c file statically (so instead
of generating the classes using a loop in C, I generate C code using a
loop in Ruby). I'd rather not go this route unless I have to.
*
* Documentation
* goes here
*/
Also, does a similar solution exist for pure ruby code?
Not at the moment.
Cheers
Dave
How do I document the methods of the class using this technique?
Paul
···
On Tue, Jul 20, 2004 at 12:14:27AM +0900, Dave Thomas wrote:
If you're writing in 'C', and if you know the names ofthe classes
you're generating, you can use
/*
* Document-class: DynamicClass
*
* Documentation
* goes here
*/
That's difficult, because presumably you're using the same method body in multiple classes.
I'm open to suggestions... :))
Cheers
Dave
···
On Jul 19, 2004, at 11:03, Paul Brannan wrote:
/*
* Document-class: DynamicClass
*
* Documentation
* goes here
*/
How do I document the methods of the class using this technique?
I will have to think about this for a while. It's definitely not
trivial. My first inclination is perhaps a special markup code that
would let me embed a ruby script in my source that interfaces with
rdoc's API to dynamically generate the documentation. Not clean to
write documentation this way, but it would allow me to generate the
documentation programmatically.
This might also be possible without modification to rdoc.
Paul
···
On Tue, Jul 20, 2004 at 01:27:20AM +0900, Dave Thomas wrote:
>How do I document the methods of the class using this technique?
That's difficult, because presumably you're using the same method body
in multiple classes.
I'm open to suggestions... :))