using rdoc to document dynamically-generated classes

P

Paul Brannan

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
 
D

Dave Thomas

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.

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
*/

Also, does a similar solution exist for pure ruby code?

Not at the moment.

Cheers

Dave
 
P

Paul Brannan

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
*/

How do I document the methods of the class using this technique?

Paul
 
D

Dave Thomas

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... :))

Cheers

Dave
 
P

Paul Brannan

That's difficult, because presumably you're using the same method body
in multiple classes.

I'm open to suggestions... :))

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top