lib/rabbit/parser/rd.rb in rabbit-1.0.8 vs lib/rabbit/parser/rd.rb in rabbit-1.0.9
- old
+ new
@@ -45,10 +45,10 @@
SNIPPET_SIZE = 10
def add_number(source, around=nil)
i = 1
puts source
- lines = source.to_a[0..-2]
+ lines = source.lines.to_a[0..-2]
if around
i = [1, around - SNIPPET_SIZE].max
lines = lines[i, 2 * SNIPPET_SIZE]
end
format = "%#{Math.log10(lines.size).truncate + 1}d %s"