diff --git a/ChangeLog b/ChangeLog index 7db1a30ab4..550e5f4174 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,6 @@ -Thu Apr 25 01:21:51 2013 Nobuyoshi Nakada +Thu Apr 25 01:22:41 2013 Nobuyoshi Nakada + + * 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. diff --git a/lib/tracer.rb b/lib/tracer.rb index 4266abf1b6..4dd2aafa7b 100644 --- a/lib/tracer.rb +++ b/lib/tracer.rb @@ -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]