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:
parent
181a4ea8c6
commit
096d52733b
2 changed files with 5 additions and 11 deletions
|
@ -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
|
* lib/debug.rb (script_lines): get source lines from SCRIPT_LINES__ or
|
||||||
read from the file.
|
read from the file.
|
||||||
|
|
|
@ -155,16 +155,8 @@ class Tracer
|
||||||
end
|
end
|
||||||
|
|
||||||
unless list = SCRIPT_LINES__[file]
|
unless list = SCRIPT_LINES__[file]
|
||||||
begin
|
list = File.readlines(file) rescue []
|
||||||
f = File::open(file)
|
SCRIPT_LINES__[file] = list
|
||||||
begin
|
|
||||||
SCRIPT_LINES__[file] = list = f.readlines
|
|
||||||
ensure
|
|
||||||
f.close
|
|
||||||
end
|
|
||||||
rescue
|
|
||||||
SCRIPT_LINES__[file] = list = []
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if l = list[line - 1]
|
if l = list[line - 1]
|
||||||
|
|
Loading…
Reference in a new issue