提交 0cbc2406 编写于 作者: R Rafael Mendonça França

Merge pull request #8744 from tricknotes/suppress-warning

Suppress warning about IO#lines in Ruby 2.0
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册