From: Daniel Berger Date: 2006-02-16T08:22:28+09:00 Subject: Minor tracer.rb patch Hi, Here's a patch that gets rid of the unnecessary (and occasionally problematic) MY_FILE_NAME constant, which I'm guessing was used for quick testing by the author: --- tracer.orig Wed Feb 15 16:13:47 2006 +++ tracer.rb Wed Feb 15 16:14:29 2006 @@ -24,8 +24,6 @@ attr :stdout, true end - MY_FILE_NAME = caller(0)[0].scan(/^(.*):[0-9]+$/)[0][0] - EVENT_SYMBOL = { "line" => "-", "call" => ">", @@ -113,7 +111,7 @@ end def trace_func(event, file, line, id, binding, klass, *) - return if file == MY_FILE_NAME + return if file == __FILE__ for p in @filters return unless p.call event, file, line, id, binding, klass @@ -155,16 +153,3 @@ end SCRIPT_LINES__ = {} unless defined? SCRIPT_LINES__ - -if caller(0).size == 1 - if $0 == Tracer::MY_FILE_NAME - # direct call - - $0 = ARGV[0] - ARGV.shift - Tracer.on - require $0 - else - Tracer.on - end -end Regards, Dan