1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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:
nobu 2013-04-24 16:22:44 +00:00
parent 181a4ea8c6
commit 096d52733b
2 changed files with 5 additions and 11 deletions

View file

@ -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.

View 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]