Debian Codegraph @

ext/coverage/lib/coverage.rb

raw
1 require "coverage.so"
2
3 module Coverage
4 def self.line_stub(file)
5 lines = File.foreach(file).map { nil }
6 iseqs = [RubyVM::InstructionSequence.compile_file(file)]
7 until iseqs.empty?
8 iseq = iseqs.pop
9 iseq.trace_points.each {|n, type| lines[n - 1] = 0 if type == :line }
10 iseq.each_child {|child| iseqs << child }
11 end
12 lines
13 end
14 end