Module: Kojak

Extended by:
Central
Defined in:
lib/kojak.rb,
lib/kojak/caller.rb,
lib/kojak/output.rb,
lib/kojak/central.rb,
lib/kojak/printer.rb,
lib/kojak/version.rb,
lib/kojak/inspector.rb,
lib/kojak/printer/basic.rb,
lib/kojak/printer/nulled.rb,
lib/kojak/printer/colorized.rb,
lib/kojak/printer/synchronized.rb,
lib/kojak/printer/randomly_colorized.rb

Defined Under Namespace

Modules: Central, Inspector Classes: Caller, Output, Printer

Constant Summary collapse

VERSION =
"0.0.1"

Class Method Summary collapse

Methods included from Central

investigate!, investigated, mark_for_investigation, print, slowlog

Class Method Details

.register_investigator_for!(cls, m) ⇒ Object

Internal: Registers investigator within given class for specified method.

cls - The Class that will be affected. m - The Method to override with investigation support.

Returns nothing.



8
9
10
11
12
13
14
15
16
17
# File 'lib/kojak/inspector.rb', line 8

def self.register_investigator_for!(cls, m)
  cls.send(:define_method, m.name) do |*args,&block|
    begin
      caller = Caller.new(m.bind(self))
      caller.call(*args,&block)
    ensure
      Kojak.print(caller) if caller
    end
  end
end