So I want to create a gem similar to VCR that starts recording method calls along with the classes those methods are in, maybe even line number, and stop recording and generate say a yml file or something which is effectively a UML sequence diagram metadata description of the run.
Extending that even further, I want to use the mermaid gem to actually spit out a picture UML diagram.
I'm thinking of taking the approach outlined in this reddit post, basically storing a array of hashes to parse into some kind of Plant text downstream. https://www.reddit.com/r/ruby/comments/11ns2l/does_a_uml_sequence_diagram_generation_gem_exist/
http://phrogz.net/ProgrammingRuby/ospace.html#tracingyourprogramsexecution
Anyways, finally, my question is... Is there a better way to approach this? Or should I just kind of follow the idea proposed in the reddit?
A simplest solution would be to generate a plant uml file. A Plant file is far simpler than an XMI file and Plant is integrated in a lot's of tool.
It could be an alternative.
plantUML
For example:
produces:
ZemUML support C-like code.
For example,
ZenUML.isAwesome()
will generate the following diagram:If your meta DSL follows the same syntax, it can be directly integrated with ZenUML. The JS library is published as npm module.