* lib/tracer.rb: merged a minor clarification patch from Daniel
Berger <Daniel.Berger at qwest.com>. [ruby-core:07376] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9951 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
ccf99b9ce6
commit
3442be4e84
@ -1,3 +1,8 @@
|
|||||||
|
Sat Feb 18 00:22:39 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* lib/tracer.rb: merged a minor clarification patch from Daniel
|
||||||
|
Berger <Daniel.Berger at qwest.com>. [ruby-core:07376]
|
||||||
|
|
||||||
Fri Feb 17 17:30:20 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
|
Fri Feb 17 17:30:20 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* eval.c (ev_const_get): simplified using rb_const_get_fallback().
|
* eval.c (ev_const_get): simplified using rb_const_get_fallback().
|
||||||
|
@ -24,8 +24,6 @@ class Tracer
|
|||||||
attr :stdout, true
|
attr :stdout, true
|
||||||
end
|
end
|
||||||
|
|
||||||
MY_FILE_NAME = caller(0)[0].scan(/^(.*):[0-9]+$/)[0][0]
|
|
||||||
|
|
||||||
EVENT_SYMBOL = {
|
EVENT_SYMBOL = {
|
||||||
"line" => "-",
|
"line" => "-",
|
||||||
"call" => ">",
|
"call" => ">",
|
||||||
@ -114,7 +112,7 @@ class Tracer
|
|||||||
end
|
end
|
||||||
|
|
||||||
def trace_func(event, file, line, id, binding, klass, *)
|
def trace_func(event, file, line, id, binding, klass, *)
|
||||||
return if file == MY_FILE_NAME
|
return if file == __FILE__
|
||||||
|
|
||||||
for p in @filters
|
for p in @filters
|
||||||
return unless p.call event, file, line, id, binding, klass
|
return unless p.call event, file, line, id, binding, klass
|
||||||
@ -157,8 +155,7 @@ end
|
|||||||
|
|
||||||
SCRIPT_LINES__ = {} unless defined? SCRIPT_LINES__
|
SCRIPT_LINES__ = {} unless defined? SCRIPT_LINES__
|
||||||
|
|
||||||
if caller(0).size == 1
|
if $0 == __FILE__
|
||||||
if $0 == Tracer::MY_FILE_NAME
|
|
||||||
# direct call
|
# direct call
|
||||||
|
|
||||||
$0 = ARGV[0]
|
$0 = ARGV[0]
|
||||||
@ -168,4 +165,3 @@ if caller(0).size == 1
|
|||||||
else
|
else
|
||||||
Tracer.on
|
Tracer.on
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user