Class: Rdepend::Printer

Inherits:
RubyProf::AbstractPrinter
  • Object
show all
Defined in:
lib/rdepend/printer.rb

Constant Summary collapse

EDGE_COLOR =
'"#666666"'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(result) ⇒ Printer

Returns a new instance of Printer.



10
11
12
13
14
# File 'lib/rdepend/printer.rb', line 10

def initialize(result)
  reset_color
  super(result)
  @seen_methods = Set.new
end

Instance Attribute Details

#colorObject (readonly)

Returns the value of attribute color.



8
9
10
# File 'lib/rdepend/printer.rb', line 8

def color
  @color
end

Instance Method Details



16
17
18
19
20
21
22
23
# File 'lib/rdepend/printer.rb', line 16

def print(output, options = {})
  setup_options(options)
  add('digraph "Profile" {', 'labelloc=t;', 'labeljust=l;')
  print_threads
  add('}')
  File.open(output, 'w') { |file| file.write(@contents.join("\n")) }
  %w(png svg).each { |ext| `dot -T#{ext} #{output} > #{output}.#{ext}` }
end