Derketo - Generate Sequence Diagrams with Ruby Tracepoint & Mermaid.js
Description
Derketo is a gem that allows you to easily generate seqeuence diagrams of your code paths by serializing a Tracepoint object into mermaid.js.
Sequence diagrams:
- Help you discover architectural, interface and logic problems early.
- Become valuable collaboration tools during design meetings because they allow you to discuss the design in concrete terms.
- Abstract much of the implementation detail and provide a high level view of system behavior, thus helping you with documentation.
Preview
Here's an example sequence diagram that was generated by Derketo:
TODO: Add PNG of MMD output.
Requirements
Getting Started
require 'derketo'
tracer = Derketo::Tracer.new()
tracer.trace { Mermaid.new.sing }
serialization = Derketo::Serializers::Mermaid.new(tracer).serialize
Derketo::Helpers.write('./tmp/test.mmd', serialization)
Integrate with Rack/Rails
All you should have to do is define the root of your project in an ENV called DERKETO_ROOT
and require 'derketo/middleware'
.
If you use Rails, just add require 'derketo/railtie
to your application.rb
.
Install
$ gem build derketo.gemspec
$ gem install derketo-<VERSION>.gem
Copyright
Copyright (c) 2018 Arcadia Power
See LICENSE for details.