tracer.rb: File.readlines
* lib/tracer.rb (get_line): simply read by File.readlines. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
181a4ea8c6
commit
096d52733b
@ -1,4 +1,6 @@
|
||||
Thu Apr 25 01:21:51 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
Thu Apr 25 01:22:41 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* lib/tracer.rb (get_line): simply read by File.readlines.
|
||||
|
||||
* lib/debug.rb (script_lines): get source lines from SCRIPT_LINES__ or
|
||||
read from the file.
|
||||
|
@ -155,16 +155,8 @@ class Tracer
|
||||
end
|
||||
|
||||
unless list = SCRIPT_LINES__[file]
|
||||
begin
|
||||
f = File::open(file)
|
||||
begin
|
||||
SCRIPT_LINES__[file] = list = f.readlines
|
||||
ensure
|
||||
f.close
|
||||
end
|
||||
rescue
|
||||
SCRIPT_LINES__[file] = list = []
|
||||
end
|
||||
list = File.readlines(file) rescue []
|
||||
SCRIPT_LINES__[file] = list
|
||||
end
|
||||
|
||||
if l = list[line - 1]
|
||||
|
Loading…
x
Reference in New Issue
Block a user