Parent

Class/Module Index [+]

Quicksearch

YARD::CLI::Graph

A command-line utility to generate Graphviz graphs from a set of objects

@see Graph#run @since 0.6.0

Attributes

objects[R]

The set of objects to include in the graph.

options[R]

The options parsed out of the commandline. Default options are:

:format => :dot

Public Class Methods

new() click to toggle source

Creates a new instance of the command-line utility

# File lib/yard/cli/graph.rb, line 18
def initialize
  super
  @serializer = YARD::Serializers::StdoutSerializer.new
  @options = SymbolHash[:format => :dot]
end

Public Instance Methods

description() click to toggle source
# File lib/yard/cli/graph.rb, line 24
def description
  "Graphs class diagram using Graphviz"
end
run(*args) click to toggle source

Runs the command-line utility.

@example

grapher = Graph.new
grapher.run('--private')

@param [Array<String>] args each tokenized argument

# File lib/yard/cli/graph.rb, line 34
def run(*args)
  Registry.load
  optparse(*args)

  contents = objects.map {|o| o.format(options) }.join("\n")
  Templates::Engine.render(:format => :dot, :type => :layout,
    :verifier => @verifier, :serializer => @serializer,
    :contents => contents)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.