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

Suppress warning about IO#lines in Ruby 2.0

actionpack/lib/action_dispatch/middleware/exception_wrapper.rb:99: IO#lines is deprecated; use #each_line instead
This commit is contained in:
Ryunosuke SATO 2013-01-04 23:30:09 +09:00
parent c9402c0258
commit 0f103679eb

View file

@ -96,7 +96,7 @@ module ActionDispatch
if File.exists?(full_path)
File.open(full_path, "r") do |file|
start = [line - 3, 0].max
lines = file.lines.drop(start).take(6)
lines = file.each_line.drop(start).take(6)
Hash[*(start+1..(lines.count+start)).zip(lines).flatten]
end
end