Sha256: 91f384180105db9174b1d4a06f55fb0b216c9819861396cf2e38f5ee9c4062f3

Contents?: true

Size: 1.27 KB

Versions: 17

Compression:

Stored size: 1.27 KB

Contents

module Simplabs

  module Excellent

    module Formatters

      # The base class for all formatters.
      class Base

        # Initializes the formatter.
        #
        # Always call +super+ in custom formatters!
        def initialize(stream)
          @stream = stream
        end

        # Called when the Simplabs::Excellent::Runner starts processing code.
        #
        # The text formatter renders the heading here ('Excellent result')
        def start
        end

        # Called whenever the Simplabs::Excellent::Runner processes a file. Yields the formatter
        #
        # You have to <tt>yield self</tt> in custom formatters. +file+ is called like that by the runner:
        #
        #  formatter.file(filename) do |formatter|
        #    warnings.each { |warning| formatter.warning(warning) }
        #  end
        def file(filename)
        end

        # Called when the Simplabs::Excellent::Runner found a warning. This warning will always refer to the last filename, +file+ was invoked with.
        def warning(warning)
        end

        # Called when the Simplabs::Excellent::Runner ends processing code.
        #
        # The text formatter renders the footer here ('Found <x> warnings').
        def end
        end

      end

    end

  end

end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
simplabs-excellent-1.3.1 lib/simplabs/excellent/formatters/base.rb
simplabs-excellent-1.4.0 lib/simplabs/excellent/formatters/base.rb
simplabs-excellent-1.4.1 lib/simplabs/excellent/formatters/base.rb
simplabs-excellent-1.4.2 lib/simplabs/excellent/formatters/base.rb
simplabs-excellent-1.5.0 lib/simplabs/excellent/formatters/base.rb
simplabs-excellent-1.5.1 lib/simplabs/excellent/formatters/base.rb
simplabs-excellent-1.5.2 lib/simplabs/excellent/formatters/base.rb
simplabs-excellent-1.5.3 lib/simplabs/excellent/formatters/base.rb
excellent-2.1.1 lib/simplabs/excellent/formatters/base.rb
excellent-2.1.0 lib/simplabs/excellent/formatters/base.rb
excellent-2.0.1 lib/simplabs/excellent/formatters/base.rb
excellent-2.0.0 lib/simplabs/excellent/formatters/base.rb
excellent-1.7.2 lib/simplabs/excellent/formatters/base.rb
excellent-1.7.1 lib/simplabs/excellent/formatters/base.rb
excellent-1.7.0 lib/simplabs/excellent/formatters/base.rb
excellent-1.6.0 lib/simplabs/excellent/formatters/base.rb
excellent-1.5.4 lib/simplabs/excellent/formatters/base.rb