From 3196645aee3add70a33f3d926d1d6e3820d39377 Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 15 Oct 1999 08:52:18 +0000 Subject: -r debug, -s, etc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/tracer.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lib/tracer.rb') diff --git a/lib/tracer.rb b/lib/tracer.rb index a8dc2a104d..095173e53b 100644 --- a/lib/tracer.rb +++ b/lib/tracer.rb @@ -40,7 +40,6 @@ class Tracer end @get_line_procs = {} - @sources = {} @filters = [] end @@ -79,17 +78,17 @@ class Tracer return p.call line end - unless list = @sources[file] + unless list = LINES__[file] # print file if $DEBUG begin f = open(file) begin - @sources[file] = list = f.readlines + LINES__[file] = list = f.readlines ensure f.close end rescue - @sources[file] = list = [] + LINES__[file] = list = [] end end if l = list[line - 1] @@ -148,6 +147,8 @@ class Tracer end +LINES__ = {} unless defined? LINES__ + if caller(0).size == 1 if $0 == Tracer::MY_FILE_NAME # direct call -- cgit v1.2.3