Class Diagrams

Hi,

Is there a popular cross-platform way to generate UML diagrams from ruby code?

Thanks,
Nick

···

--
Nicholas Van Weerdenburg

Not quite what you're looking for, but you can take a look at
ObjectGraph (objectgraph.rubyforge.org) at how to dymanically evaluate
classes and generate a png graph using GraphViz. You can set some
graphviz options to make the output *look* a bit more UMLish, but it's
not proper UML.

I am not aware of any tool that reads ruby to generate UML (and would
love to hear if there are!). You might have to follow the same process
as ObjectGraph, but generating an XMI document to load into an existing
tool.

There is just one more question that need to be asked: are you sure
that is what you need? I find that because of ruby compactness of code
and duck-typing arguments you rarely use much of inheritance etc. As
for activity diagrams, you can not normally get them from static code
analysis so you'd have to do them by hand anyway.

Cheers,
Assaph

ParseTree will get you started on such a tool.

PGP.sig (186 Bytes)

···

On 24 Jan 2005, at 17:35, Assaph Mehr wrote:

I am not aware of any tool that reads ruby to generate UML (and would
love to hear if there are!). You might have to follow the same process
as ObjectGraph, but generating an XMI document to load into an existing
tool.

--
Eric Hodel - drbrain@segment7.net - http://segment7.net
FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04

I might be happy with objectgraph. I like UML, but hate UML tools. So,
I figure I could write Ruby and use a tool to visualize the code for
insight and creating documentation.

I'd also find it interesting to apply it to existing Ruby libraries to
get a sense of their structure.

Whether it is really useful, I won't know until I try :).

Thanks,
Nick

···

On Tue, 25 Jan 2005 10:35:50 +0900, Assaph Mehr <assaph@gmail.com> wrote:

Not quite what you're looking for, but you can take a look at
ObjectGraph (objectgraph.rubyforge.org) at how to dymanically evaluate
classes and generate a png graph using GraphViz. You can set some
graphviz options to make the output *look* a bit more UMLish, but it's
not proper UML.

I am not aware of any tool that reads ruby to generate UML (and would
love to hear if there are!). You might have to follow the same process
as ObjectGraph, but generating an XMI document to load into an existing
tool.

There is just one more question that need to be asked: are you sure
that is what you need? I find that because of ruby compactness of code
and duck-typing arguments you rarely use much of inheritance etc. As
for activity diagrams, you can not normally get them from static code
analysis so you'd have to do them by hand anyway.

Cheers,
Assaph

--
Nicholas Van Weerdenburg

I've meaning to look at it, but haven't had the time to-date.

Thanks,
Nick

···

On Tue, 25 Jan 2005 12:14:00 +0900, Eric Hodel <drbrain@segment7.net> wrote:

On 24 Jan 2005, at 17:35, Assaph Mehr wrote:

> I am not aware of any tool that reads ruby to generate UML (and would
> love to hear if there are!). You might have to follow the same process
> as ObjectGraph, but generating an XMI document to load into an existing
> tool.

ParseTree will get you started on such a tool.

--
Eric Hodel - drbrain@segment7.net - http://segment7.net
FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04

--
Nicholas Van Weerdenburg

Nicholas Van Weerdenburg ha scritto:

Not quite what you're looking for, but you can take a look at
ObjectGraph (objectgraph.rubyforge.org) at how to dymanically evaluate
classes and generate a png graph using GraphViz. You can set some
graphviz options to make the output *look* a bit more UMLish, but it's
not proper UML.

I am not aware of any tool that reads ruby to generate UML (and would
love to hear if there are!). You might have to follow the same process
as ObjectGraph, but generating an XMI document to load into an existing
tool.

There is just one more question that need to be asked: are you sure
that is what you need? I find that because of ruby compactness of code
and duck-typing arguments you rarely use much of inheritance etc. As
for activity diagrams, you can not normally get them from static code
analysis so you'd have to do them by hand anyway.

Cheers,
Assaph

I might be happy with objectgraph. I like UML, but hate UML tools. So,
I figure I could write Ruby and use a tool to visualize the code for
insight and creating documentation.

I'd also find it interesting to apply it to existing Ruby libraries to
get a sense of their structure.

metoo!

Whether it is really useful, I won't know until I try :).

Thanks,
Nick

just a thing: there is rdoc --diagram that may help. Very little, but better than nothing :slight_smile:

···

On Tue, 25 Jan 2005 10:35:50 +0900, Assaph Mehr <assaph@gmail.com> wrote:

Glom your orbs on this:

   http://blog.zenspider.com/archives/2005/01/parse_tree_visu_1.html

(be sure to look at the "ginormous" link as well)

Not quite what you are asking for, but a good start and very very easy to move in the direction you'd like. The code is only 66 lines for the graph class, 61 lines for the sexp processor, and 86 lines to process command line options and snoop classes. Not bad, eh?

···

On Jan 24, 2005, at 8:33 PM, Nicholas Van Weerdenburg wrote:

I've meaning to look at it, but haven't had the time to-date.

I didn't even know there was such a thing. I'll check it out.

Thanks,
Nick

···

On Wed, 26 Jan 2005 03:10:50 +0900, gabriele renzi <rff_rff@remove-yahoo.it> wrote:

Nicholas Van Weerdenburg ha scritto:
> On Tue, 25 Jan 2005 10:35:50 +0900, Assaph Mehr <assaph@gmail.com> wrote:
>
>>Not quite what you're looking for, but you can take a look at
>>ObjectGraph (objectgraph.rubyforge.org) at how to dymanically evaluate
>>classes and generate a png graph using GraphViz. You can set some
>>graphviz options to make the output *look* a bit more UMLish, but it's
>>not proper UML.
>>
>>I am not aware of any tool that reads ruby to generate UML (and would
>>love to hear if there are!). You might have to follow the same process
>>as ObjectGraph, but generating an XMI document to load into an existing
>>tool.
>>
>>There is just one more question that need to be asked: are you sure
>>that is what you need? I find that because of ruby compactness of code
>>and duck-typing arguments you rarely use much of inheritance etc. As
>>for activity diagrams, you can not normally get them from static code
>>analysis so you'd have to do them by hand anyway.
>>
>>Cheers,
>>Assaph
>>
>>
>
>
> I might be happy with objectgraph. I like UML, but hate UML tools. So,
> I figure I could write Ruby and use a tool to visualize the code for
> insight and creating documentation.
>
> I'd also find it interesting to apply it to existing Ruby libraries to
> get a sense of their structure.

metoo!

> Whether it is really useful, I won't know until I try :).
>
> Thanks,
> Nick

just a thing: there is rdoc --diagram that may help. Very little, but
better than nothing :slight_smile:

--
Nicholas Van Weerdenburg

Very nice. And nice sql table diagrams as well for your book web app.

Nick

···

On Tue, 25 Jan 2005 16:31:27 +0900, Ryan Davis <ryand-ruby@zenspider.com> wrote:

On Jan 24, 2005, at 8:33 PM, Nicholas Van Weerdenburg wrote:

> I've meaning to look at it, but haven't had the time to-date.

Glom your orbs on this:

   http://blog.zenspider.com/archives/2005/01/parse_tree_visu_1.html

(be sure to look at the "ginormous" link as well)

Not quite what you are asking for, but a good start and very very easy
to move in the direction you'd like. The code is only 66 lines for the
graph class, 61 lines for the sexp processor, and 86 lines to process
command line options and snoop classes. Not bad, eh?

--
Nicholas Van Weerdenburg