Permalink
Browse files

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
  • Loading branch information...
1 parent c9402c0 commit 0f103679eb37ad5b76e21100166b91769b989f9e @tricknotes tricknotes committed Jan 4, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 actionpack/lib/action_dispatch/middleware/exception_wrapper.rb
@@ -96,7 +96,7 @@ def source_fragment(path, line)
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

0 comments on commit 0f10367

Please sign in to comment.