Class: Bundler::Graph::GraphVizClient

### Home Classes Methods

### In Files

- lib/bundler/graph.rb

### Parent

Object

### Methods

- ::new
- #g
- #run

### Files

- bundle
- bundle-config
- bundle-config.txt
- bundle-exec
- bundle-exec.txt
- bundle-install
- bundle-install.txt
- bundle-package
- bundle-package.txt
- bundle-platform
- bundle-platform.txt
- bundle-update
- bundle-update.txt
- bundle.txt
- gemfile.5.txt
- Executable
- Gemfile

### Class/Module Index

Quicksearch

- Bundler
- Bundler::BundlerError
- Bundler::CLI
- Bundler::Definition
- Bundler::DepProxy
- Bundler::Dependency
- Bundler::Deployment
- Bundler::Deprecate
- Bundler::DeprecatedError
- Bundler::Dsl
- Bundler::EndpointSpecification
- Bundler::Env
- Bundler::Environment
- Bundler::Fetcher
- Bundler::Fetcher::CertificateFailureError
- Bundler::Fetcher::FallbackError
- Bundler::Fetcher::SSLError
- Bundler::GemHelper
- Bundler::GemHelpers
- Bundler::GemInstaller
- Bundler::GemNotFound
- Bundler::GemfileError
- Bundler::GemfileNotFound
- Bundler::GemspecError
- Bundler::GitError
- Bundler::Graph
- Bundler::Graph::GraphVizClient
- Bundler::HTTPError
- Bundler::Index
- Bundler::Injector
- Bundler::InstallError
- Bundler::InstallHookError
- Bundler::Installer
- Bundler::InvalidOption
- Bundler::InvalidSpecSet
- Bundler::LazySpecification
- Bundler::LockfileError
- Bundler::LockfileParser
- Bundler::MarshalError
- Bundler::MatchPlatform
- Bundler::PathError
- Bundler::ProductionError
- Bundler::RemoteSpecification
- Bundler::Resolver
- Bundler::Resolver::SpecGroup
- Bundler::RubyDsl
- Bundler::RubyVersion
- Bundler::RubyVersionMismatch
- Bundler::RubygemsIntegration
- Bundler::RubygemsIntegration::AlmostModern
- Bundler::RubygemsIntegration::Ancient
- Bundler::RubygemsIntegration::Future
- Bundler::RubygemsIntegration::Gem
- Bundler::RubygemsIntegration::Gem::SourceIndex
- Bundler::RubygemsIntegration::Legacy
- Bundler::RubygemsIntegration::Modern
- Bundler::RubygemsIntegration::Transitional
- Bundler::Runtime
- Bundler::SecurityError
- Bundler::Settings
- Bundler::SharedHelpers
- Bundler::SimilarityDetector
- Bundler::Source
- Bundler::Source::Git
- Bundler::Source::Git::GitProxy
- Bundler::Source::Path
- Bundler::Source::Path::Installer
- Bundler::Source::Rubygems
- Bundler::SpecSet
- Bundler::SystemRubyVersion
- Bundler::UI
- Bundler::UI::RGProxy
- Bundler::UI::Shell
- Bundler::VersionConflict
- Gem
- Gem::Dependency
- Gem::Platform
- Gem::Requirement
- Gem::Specification
- Object

No matching classes.

# Bundler::Graph::GraphVizClient

### Public Class Methods

new(graph_instance) click to toggle source

    # File lib/bundler/graph.rb, line 110
    def initialize(graph_instance)
      @graph_name    = graph_instance.class::GRAPH_NAME
      @groups        = graph_instance.groups
      @relations     = graph_instance.relations
      @node_options  = graph_instance.node_options
      @edge_options  = graph_instance.edge_options
      @output_file   = graph_instance.output_file
      @output_format = graph_instance.output_format
    end

### Public Instance Methods

g() click to toggle source

    # File lib/bundler/graph.rb, line 120
    def g
      @g ||= ::GraphViz.digraph(@graph_name, {:concentrate => true, :normalize => true, :nodesep => 0.55}) do |g|
        g.edge[:weight]   = 2
        g.edge[:fontname] = g.node[:fontname] = 'Arial, Helvetica, SansSerif'
        g.edge[:fontsize] = 12
      end
    end

run() click to toggle source

    # File lib/bundler/graph.rb, line 128
    def run
      @groups.each do |group|
        g.add_nodes(
          group,
          {:style     => 'filled',
           :fillcolor => '#B9B9D5',
           :shape     => "box3d",
           :fontsize  => 16}.merge(@node_options[group])
        )
      end

      @relations.each do |parent, children|
        children.each do |child|
          if @groups.include?(parent)
            g.add_nodes(child, {:style => 'filled', :fillcolor => '#B9B9D5'}.merge(@node_options[child]))
            g.add_edges(parent, child, {:constraint => false}.merge(@edge_options["#{parent}_#{child}"]))
          else
            g.add_nodes(child, @node_options[child])
            g.add_edges(parent, child, @edge_options["#{parent}_#{child}"])
          end
        end
      end

      if @output_format.to_s == "debug"
        $stdout.puts g.output :none => String
        Bundler.ui.info "debugging bundle viz..."
      else
        begin
          g.output @output_format.to_sym => "#{@output_file}.#{@output_format}"
          Bundler.ui.info "#{@output_file}.#{@output_format}"
        rescue ArgumentError => e
          $stderr.puts "Unsupported output format. See Ruby-Graphviz/lib/graphviz/constants.rb"
          raise e
        end
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.