Class: Rdepend::Printer
- Inherits:
-
RubyProf::AbstractPrinter
- Object
- RubyProf::AbstractPrinter
- Rdepend::Printer
- Defined in:
- lib/rdepend/printer.rb
Constant Summary collapse
- EDGE_COLOR =
'"#666666"'
Instance Attribute Summary collapse
-
#color ⇒ Object
readonly
Returns the value of attribute color.
Instance Method Summary collapse
-
#initialize(result) ⇒ Printer
constructor
A new instance of Printer.
- #print(output, options = {}) ⇒ Object
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
#color ⇒ Object (readonly)
Returns the value of attribute color.
8 9 10 |
# File 'lib/rdepend/printer.rb', line 8 def color @color end |
Instance Method Details
#print(output, options = {}) ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/rdepend/printer.rb', line 16 def print(output, = {}) () add('digraph "Profile" {') add('ratio="2.0";', '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 |