Skip to content

Commit 0f10367

Browse files
committed
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
1 parent c9402c0 commit 0f10367

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

actionpack/lib/action_dispatch/middleware/exception_wrapper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def source_fragment(path, line)
9696
if File.exists?(full_path)
9797
File.open(full_path, "r") do |file|
9898
start = [line - 3, 0].max
99-
lines = file.lines.drop(start).take(6)
99+
lines = file.each_line.drop(start).take(6)
100100
Hash[*(start+1..(lines.count+start)).zip(lines).flatten]
101101
end
102102
end

0 commit comments

Comments
 (0)