require 'simplabs/excellent/formatters/base' module Simplabs module Excellent module Formatters class Html < Base #:nodoc: def initialize(stream = $stdout) super end def start @stream.write(HEADER_TEMPLATE) end def file(filename) @stream.write(START_FIlE_TAMPLATE.sub('{{filename}}', filename)) yield self @stream.write(END_FIlE_TAMPLATE) end def warning(warning) @stream.write(WARNING_TEMPLATE.sub('{{line_number}}', warning.line_number.to_s).sub('{{message}}', warning.message)) end def end @stream.write(FOOTER_TEMPLATE) end HEADER_TEMPLATE = <<-END