diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-04-24 16:22:44 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-04-24 16:22:44 +0000 |
commit | 096d52733b78df9e75837ff8ffc4f4d1010abd04 (patch) | |
tree | 2236b2e652914c2002e3715f26ac5dc052607ad0 /lib/tracer.rb | |
parent | 181a4ea8c6fce1c0388050ab4c914a0f1281926b (diff) | |
download | ruby-096d52733b78df9e75837ff8ffc4f4d1010abd04.tar.gz |
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
Diffstat (limited to 'lib/tracer.rb')
-rw-r--r-- | lib/tracer.rb | 12 |
1 files changed, 2 insertions, 10 deletions
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] |