Sha256: a3f3d10658232906cb28fce23500a5750fc237f170dfb6a625d6a1239d6cb909

Contents?: true

Size: 728 Bytes

Versions: 13

Compression:

Stored size: 728 Bytes

Contents

require 'simplabs/excellent/formatters/base'

module Simplabs

  module Excellent

    module Formatters

      class Text < Base #:nodoc:

        def initialize(stream = $stdout)
          super
          @total_warnings = 0
        end

        def start
          @stream.puts "\n  Excellent result:\n"
        end

        def file(filename)
          @stream.puts "\n  #{filename}\n"
          yield self
        end

        def warning(warning)
          @stream.puts "    * Line #{warning.line_number.to_s.lpad(3)}: \e[33m#{warning.message}\e[0m"
          @total_warnings += 1
        end

        def end
          @stream.puts "\n  Found #{@total_warnings} warnings.\n\n"
        end

      end

    end

  end

end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
simplabs-excellent-1.3.1 lib/simplabs/excellent/formatters/text.rb
simplabs-excellent-1.4.0 lib/simplabs/excellent/formatters/text.rb
simplabs-excellent-1.4.1 lib/simplabs/excellent/formatters/text.rb
simplabs-excellent-1.4.2 lib/simplabs/excellent/formatters/text.rb
simplabs-excellent-1.5.0 lib/simplabs/excellent/formatters/text.rb
simplabs-excellent-1.5.1 lib/simplabs/excellent/formatters/text.rb
simplabs-excellent-1.5.2 lib/simplabs/excellent/formatters/text.rb
simplabs-excellent-1.5.3 lib/simplabs/excellent/formatters/text.rb
excellent-1.7.2 lib/simplabs/excellent/formatters/text.rb
excellent-1.7.1 lib/simplabs/excellent/formatters/text.rb
excellent-1.7.0 lib/simplabs/excellent/formatters/text.rb
excellent-1.6.0 lib/simplabs/excellent/formatters/text.rb
excellent-1.5.4 lib/simplabs/excellent/formatters/text.rb