Skip to content

Commit

Permalink
Merge pull request #8744 from tricknotes/suppress-warning
Browse files Browse the repository at this point in the history
Suppress warning about IO#lines in Ruby 2.0
  • Loading branch information
rafaelfranca committed Jan 4, 2013
2 parents c9402c0 + 0f10367 commit 0cbc240
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -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
Expand Down

0 comments on commit 0cbc240

Please sign in to comment.