summaryrefslogtreecommitdiff
path: root/lib/tracer.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-24 16:22:44 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-24 16:22:44 +0000
commit096d52733b78df9e75837ff8ffc4f4d1010abd04 (patch)
tree2236b2e652914c2002e3715f26ac5dc052607ad0 /lib/tracer.rb
parent181a4ea8c6fce1c0388050ab4c914a0f1281926b (diff)
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.rb12
1 files changed, 2 insertions, 10 deletions
diff --git a/lib/tracer.rb b/lib/tracer.rb
index 4266abf..4dd2aaf 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]