Class: Bundler::Graph

Inherits:
Object
  • Object
show all
Defined in:
lib/bundler/graph.rb

Defined Under Namespace

Classes: GraphVizClient

Constant Summary collapse

GRAPH_NAME =
:Gemfile

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(env, output_file, show_version = false, show_requirements = false, output_format = "png", without = []) ⇒ Graph

Returns a new instance of Graph.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/bundler/graph.rb', line 7

def initialize(env, output_file, show_version = false, show_requirements = false, output_format = "png", without = [])
  @env               = env
  @output_file       = output_file
  @show_version      = show_version
  @show_requirements = show_requirements
  @output_format     = output_format
  @without_groups    = without.map(&:to_sym)

  @groups            = []
  @relations         = Hash.new {|h, k| h[k] = Set.new }
  @node_options      = {}
  @edge_options      = {}

  _patching_gem_dependency_class
  _populate_relations
end

Instance Attribute Details

#edge_optionsObject (readonly)

Returns the value of attribute edge_options.



24
25
26
# File 'lib/bundler/graph.rb', line 24

def edge_options
  @edge_options
end

#groupsObject (readonly)

Returns the value of attribute groups.



24
25
26
# File 'lib/bundler/graph.rb', line 24

def groups
  @groups
end

#node_optionsObject (readonly)

Returns the value of attribute node_options.



24
25
26
# File 'lib/bundler/graph.rb', line 24

def node_options
  @node_options
end

#output_fileObject (readonly)

Returns the value of attribute output_file.



24
25
26
# File 'lib/bundler/graph.rb', line 24

def output_file
  @output_file
end

#output_formatObject (readonly)

Returns the value of attribute output_format.



24
25
26
# File 'lib/bundler/graph.rb', line 24

def output_format
  @output_format
end

#relationsObject (readonly)

Returns the value of attribute relations.



24
25
26
# File 'lib/bundler/graph.rb', line 24

def relations
  @relations
end

Instance Method Details

#vizObject



26
27
28
# File 'lib/bundler/graph.rb', line 26

def viz
  GraphVizClient.new(self).run
end