class Covered::Summary
def call(wrapper, output = $stdout)
def call(wrapper, output = $stdout) statistics = self.each(wrapper) do |coverage| line_offset = 1 path = wrapper.relative_path(coverage.path) output.puts "", Rainbow(path).bold.underline counts = coverage.counts coverage.read do |file| file.each_line do |line| count = counts[line_offset] print_annotations(output, coverage, line, line_offset) output.write("#{line_offset}|".rjust(8)) output.write("#{count}|".rjust(8)) if count == nil output.write Rainbow(line).faint elsif count == 0 output.write Rainbow(line).red else output.write Rainbow(line).green end # If there was no newline at end of file, we add one: unless line.end_with? $/ output.puts end line_offset += 1 end end coverage.print(output) end statistics.print(output) end