Class: YARD::CLI::Graph
Overview
A command-line utility to generate Graphviz graphs from a set of objects
Instance Attribute Summary (collapse)
-
- (Object) objects
readonly
The set of objects to include in the graph.
-
- (Object) options
readonly
The options parsed out of the commandline.
Instance Method Summary (collapse)
- - (Object) description
-
- (Graph) initialize
constructor
Creates a new instance of the command-line utility.
-
- (Object) run(*args)
Runs the command-line utility.
Methods inherited from Command
#common_options, #load_script, #parse_options, run
Constructor Details
- (Graph) initialize
Creates a new instance of the command-line utility
18 19 20 21 22 |
# File 'lib/yard/cli/graph.rb', line 18 def initialize super @serializer = YARD::Serializers::StdoutSerializer.new @options = SymbolHash[:format => :dot] end |
Instance Attribute Details
- (Object) objects (readonly)
The set of objects to include in the graph.
15 16 17 |
# File 'lib/yard/cli/graph.rb', line 15 def objects @objects end |
- (Object) options (readonly)
The options parsed out of the commandline. Default options are:
:format => :dot
12 13 14 |
# File 'lib/yard/cli/graph.rb', line 12 def @options end |
Instance Method Details
- (Object) description
24 25 26 |
# File 'lib/yard/cli/graph.rb', line 24 def description "Graphs class diagram using Graphviz" end |
- (Object) run(*args)
Runs the command-line utility.
34 35 36 37 38 39 40 41 42 |
# File 'lib/yard/cli/graph.rb', line 34 def run(*args) Registry.load optparse(*args) contents = objects.map {|o| o.format() }.join("\n") Templates::Engine.render(:format => :dot, :type => :layout, :verifier => @verifier, :serializer => @serializer, :contents => contents) end |