Sha256: b26bb8fb670ff35e8f3dc4359a78668299d5af3242bbb05f5b50e52d01ab6f75

Contents?: true

Size: 981 Bytes

Versions: 7

Compression:

Stored size: 981 Bytes

Contents

# encoding: utf-8

module Pelusa
  class StdoutReporter < Reporter
    def self.print_banner
      puts "  \e[0;35mϟ\e[0m \e[0;32mPelusa \e[0;35mϟ\e[0m"
      puts "  \e[0;37m----------\e[0m"
    end

    def report
      puts "  \e[0;36m#{@filename}\e[0m"
      puts

      @reports.each do |class_report|
        print_report(class_report)
      end
    end

    private

    def print_report(class_report)
      class_name = class_report.class_name

      puts "  class #{class_name}"

      analyses = class_report.analyses
      analyses.each do |analysis|
        print_analysis(analysis)
      end
      puts
    end

    def print_analysis(analysis)
      name    = analysis.name
      status  = analysis.status
      message = analysis.message

      print "    \e[0;33m✿ %s \e[0m" % name

      if analysis.successful?
        print "\e[0;32m✓\e[0m\n"
        return
      end

      print "\e[0;31m✗\n\t"
      puts message
      print "\e[0m"
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
pelusa-0.2.2 lib/pelusa/reporters/stdout_reporter.rb
pelusa-0.2.1 lib/pelusa/reporters/stdout_reporter.rb
pelusa-0.2.0 lib/pelusa/reporters/stdout_reporter.rb
pelusa-0.1.1 lib/pelusa/reporters/stdout_reporter.rb
pelusa-0.1.0 lib/pelusa/reporters/stdout_reporter.rb
pelusa-0.0.2 lib/pelusa/reporters/stdout_reporter.rb
pelusa-0.0.1 lib/pelusa/reporters/stdout_reporter.rb