class Covered::MarkdownSummary

def call(wrapper, output = $stdout)

@parameter output [IO] The output stream.
@parameter wrapper [Covered::Base] The coverage wrapper to report.
A coverage array gives, for each line, the number of line executions by the interpreter. A `nil` value means coverage is finished for this line (lines like `else` and `end`).
def call(wrapper, output = $stdout)
	output.puts "# Coverage Report"
	output.puts
	
	ordered = []
	buffer = StringIO.new
	
	statistics = self.each(wrapper) do |coverage|
		ordered << coverage unless coverage.complete?
	end
	
	statistics.print(output)
	
	if ordered.any?
		output.puts "", "\#\# Least Coverage:", ""
		ordered.sort_by!(&:missing_count).reverse!
		
		ordered.first(5).each do |coverage|
			path = wrapper.relative_path(coverage.path)
			
			output.puts "- `#{path}`: #{coverage.missing_count} lines not executed!"
		end
	end
	
	output.print(buffer.string)
end