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 33
def initialize
  super
  @use_document_file = false
  @options = GraphOptions.new
  options.reset_defaults
  options.serializer = YARD::Serializers::StdoutSerializer.new
end

Public Instance Methods

description() click to toggle source
# File lib/yard/cli/graph.rb, line 41
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 51
def run(*args)
  parse_arguments(*args)
  Registry.load

  contents = objects.map do |o|
    o.format(options.merge(:serialize => false))
  end.join("\n")
  opts = {:type => :layout, :contents => contents}
  options.update(opts)
  Templates::Engine.render(options)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.