Class: Rdepend::Trace
- Inherits:
-
Object
- Object
- Rdepend::Trace
- Defined in:
- lib/rdepend/trace.rb
Class Method Summary collapse
- .base ⇒ Object
- .exec(&block) ⇒ Object
- .halt_with_message ⇒ Object
- .init(paths = [Dir.pwd]) ⇒ Object
- .stop ⇒ Object
Class Method Details
.base ⇒ Object
45 46 47 |
# File 'lib/rdepend/trace.rb', line 45 def self.base File.basename($0) end |
.exec(&block) ⇒ Object
34 35 36 37 38 |
# File 'lib/rdepend/trace.rb', line 34 def self.exec(&block) self.init yield self.stop end |
.halt_with_message ⇒ Object
57 58 59 60 |
# File 'lib/rdepend/trace.rb', line 57 def self. puts "⏳ Exiting, but writing an Ꝛdepend graph first, so please wait!" self.stop end |
.init(paths = [Dir.pwd]) ⇒ Object
40 41 42 43 |
# File 'lib/rdepend/trace.rb', line 40 def self.init(paths = [Dir.pwd]) @paths = paths RubyProf.start end |
.stop ⇒ Object
49 50 51 52 53 54 55 |
# File 'lib/rdepend/trace.rb', line 49 def self.stop result = RubyProf.stop result.eliminate_methods!(@paths) puts "Writing Ꝛdepend graph to rdepend/#{base}.dot.svg" Dir.mkdir('rdepend') unless Dir.exist?('rdepend') Rdepend::Printer.new(result).print("rdepend/#{base}.dot") end |