Sha256: 6f9639d162319f6dd2c564ee2a1af2140e7873096b905bd7363d46fe4de51037

Contents?: true

Size: 407 Bytes

Versions: 15

Compression:

Stored size: 407 Bytes

Contents

require 'digest'
require_relative 'graph'

class DebugGraph
  def initialize(config)
    @g = Graph.new(config)
  end

  def add_node(name)
    @g.add_node(h(name)) if name
  end

  def add_edge(from, to, opts)
    @g.add_edge(h(from), h(to), opts.update(label: h(opts[:label])))
  end

  def output(renderer)
    @g.output(renderer)
  end

  private
  def h(msg)
    Digest::SHA256.hexdigest msg
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
aws_security_viz-0.1.4.pre.alpha.pre.81 lib/debug_graph.rb
aws_security_viz-0.1.4.pre.alpha.pre.77 lib/debug_graph.rb
aws_security_viz-0.1.4.pre.alpha.pre.75 lib/debug_graph.rb
aws_security_viz-0.1.4.pre.alpha.pre.73 lib/debug_graph.rb
aws_security_viz-0.1.3 lib/debug_graph.rb
aws_security_viz-0.1.3.pre.alpha.pre.71 lib/debug_graph.rb
aws_security_viz-0.1.3.pre.alpha.pre.70 lib/debug_graph.rb
aws_security_viz-0.1.3.pre.alpha.pre.69 lib/debug_graph.rb
aws_security_viz-0.1.3.pre.alpha.pre.68 lib/debug_graph.rb
aws_security_viz-0.1.3.pre.alpha.pre.64 lib/debug_graph.rb
aws_security_viz-0.1.3.pre.alpha.pre.63 lib/debug_graph.rb
aws_security_viz-0.1.2 lib/debug_graph.rb
aws_security_viz-0.1.2.pre.alpha.pre.61 lib/debug_graph.rb
aws_security_viz-0.1.2.pre.alpha.pre.60 lib/debug_graph.rb
aws_security_viz-0.1.2.pre.alpha.pre.59 lib/debug_graph.rb