Class: Rdepend::Trace

Inherits:
Object
  • Object
show all
Defined in:
lib/rdepend/trace.rb

Class Method Summary collapse

Class Method Details

.exec(&block) ⇒ Object



7
8
9
10
11
# File 'lib/rdepend/trace.rb', line 7

def self.exec(&block)
  self.start
  yield
  self.stop
end

.halt_with_messageObject



25
26
27
28
# File 'lib/rdepend/trace.rb', line 25

def self.halt_with_message
  puts "⏳  Exiting, but writing an Ꝛdepend graph first, so please wait!"
  self.stop
end

.initObject



13
14
15
# File 'lib/rdepend/trace.rb', line 13

def self.init
  RubyProf.start
end

.stopObject



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

def self.stop
  result = RubyProf.stop
  result.eliminate_methods!([/Integer#times/])
  printer = Rdepend::Printer.new(result)
  puts "Writing Ꝛdepend graph to #{$0}.dot.svg"
  printer.print("#{$0}.dot")
end