# File lib/bundler/graph.rb, line 91 91: def initialize(graph_instance) 92: @graph_name = graph_instance.class::GRAPH_NAME 93: @groups = graph_instance.groups 94: @relations = graph_instance.relations 95: @node_options = graph_instance.node_options 96: @edge_options = graph_instance.edge_options 97: @output_file = graph_instance.output_file 98: @output_format = graph_instance.output_format 99: end
# File lib/bundler/graph.rb, line 101 101: def g 102: require 'graphviz' 103: @g ||= ::GraphViz.digraph(@graph_name, {:concentrate => true, :normalize => true, :nodesep => 0.55}) do |g| 104: g.edge[:weight] = 2 105: g.edge[:fontname] = g.node[:fontname] = 'Arial, Helvetica, SansSerif' 106: g.edge[:fontsize] = 12 107: end 108: end
# File lib/bundler/graph.rb, line 110 110: def run 111: @groups.each do |group| 112: g.add_node( 113: group, 114: {:style => 'filled', 115: :fillcolor => '#B9B9D5', 116: :shape => "box3d", 117: :fontsize => 16}.merge(@node_options[group]) 118: ) 119: end 120: 121: @relations.each do |parent, children| 122: children.each do |child| 123: if @groups.include?(parent) 124: g.add_node(child, {:style => 'filled', :fillcolor => '#B9B9D5'}.merge(@node_options[child])) 125: g.add_edge(parent, child, {:constraint => false}.merge(@edge_options["#{parent}_#{child}"])) 126: else 127: g.add_node(child, @node_options[child]) 128: g.add_edge(parent, child, @edge_options["#{parent}_#{child}"]) 129: end 130: end 131: end 132: 133: if @output_format.to_s == "debug" 134: $stdout.puts g.output :none => String 135: Bundler.ui.info "debugging bundle viz..." 136: else 137: begin 138: g.output @output_format.to_sym => "#{@output_file}.#{@output_format}" 139: Bundler.ui.info "#{@output_file}.#{@output_format}" 140: rescue ArgumentError => e 141: $stderr.puts "Unsupported output format. See Ruby-Graphviz/lib/graphviz/constants.rb" 142: raise e 143: end 144: end 145: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.