Module: Snapbot::Diagram
- Defined in:
- lib/snapbot/diagram.rb,
lib/snapbot/diagram/renderer.rb,
lib/snapbot/diagram/dot_generator.rb
Overview
Print the small constellation of objects in your integration test and how they relate. Requires Graphviz. Optimised for Mac. YMMV.
Defined Under Namespace
Classes: DotGenerator, Renderer
Instance Method Summary
collapse
Instance Method Details
#launchy_present? ⇒ Boolean
27
28
29
30
31
32
|
# File 'lib/snapbot/diagram.rb', line 27
def launchy_present?
require "launchy"
true
rescue LoadError
false
end
|
#save_and_open_diagram(path = Renderer::DEFAULT_OUTPUT_FILENAME, **args) ⇒ Object
10
11
12
13
14
15
16
17
18
19
|
# File 'lib/snapbot/diagram.rb', line 10
def save_and_open_diagram(path = Renderer::DEFAULT_OUTPUT_FILENAME, **args)
filename = save_diagram(path, **args)
unless launchy_present?
warn "Cannot open diagram – install `launchy`."
return
end
Launchy.open(filename)
end
|
#save_diagram(path = Renderer::DEFAULT_OUTPUT_FILENAME, **args) ⇒ Object