relevance-rcov 0.8.5 → 0.8.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/rcov/version.rb +1 -1
- data/lib/rcov.rb +5 -5
- metadata +1 -1
data/lib/rcov/version.rb
CHANGED
data/lib/rcov.rb
CHANGED
@@ -287,8 +287,7 @@ class FileStatistics
|
|
287
287
|
scanner = StringScanner.new(@lines[i])
|
288
288
|
j = k = i
|
289
289
|
loop do
|
290
|
-
scanned_text = scanner.search_full(/<<(-?)(?:(['"`])((?:(?!\2).)+)\2|([A-Z_a-z]\w*))/,
|
291
|
-
true, true)
|
290
|
+
scanned_text = scanner.search_full(/<<(-?)(?:(['"`])((?:(?!\2).)+)\2|([A-Z_a-z]\w*))/, true, true)
|
292
291
|
# k is the first line after the end delimiter for the last heredoc
|
293
292
|
# scanned so far
|
294
293
|
unless scanner.matched?
|
@@ -304,8 +303,7 @@ class FileStatistics
|
|
304
303
|
break
|
305
304
|
end
|
306
305
|
must_mark = []
|
307
|
-
end_of_heredoc = (scanner[1] == "-") ?
|
308
|
-
/^\s*#{Regexp.escape(term)}$/ : /^#{Regexp.escape(term)}$/
|
306
|
+
end_of_heredoc = (scanner[1] == "-") ? /^\s*#{Regexp.escape(term)}$/ : /^#{Regexp.escape(term)}$/
|
309
307
|
loop do
|
310
308
|
break if j == @lines.size
|
311
309
|
must_mark << j
|
@@ -318,7 +316,9 @@ class FileStatistics
|
|
318
316
|
must_mark.each{|lineidx| @coverage[lineidx] ||= :inferred}
|
319
317
|
end
|
320
318
|
# move the "first line after heredocs" index
|
321
|
-
|
319
|
+
if @lines[j+=1] =~ /^\s*\n$/
|
320
|
+
k = j
|
321
|
+
end
|
322
322
|
break
|
323
323
|
end
|
324
324
|
j += 1
|