Sha256: fb73b4cfb73cee5e7a4d65f67734c2080454d43aa14ee05db7740f6ef87956af

Contents?: true

Size: 662 Bytes

Versions: 16

Compression:

Stored size: 662 Bytes

Contents

# frozen_string_literal: true

module SimpleCov::Formatter::Terminal::ColorPrinting
  # rubocop:disable Metrics/CyclomaticComplexity
  def color(message, color)
    case color
    when :white then "\e[0;37;49m#{message}\e[0m"
    when :red then "\e[0;31m#{message}\e[0m"
    when :green then "\e[1;32;49m#{message}\e[0m"
    when :yellow then "\e[0;33m#{message}\e[0m"
    when :white_on_green then "\e[1;39;102m#{message}\e[0m"
    when :red_on_yellow then "\e[0;31;103m#{message}\e[0m"
    when :white_on_red then "\e[1;37;41m#{message}\e[0m"
    else raise("Unknown color format '#{color}'.")
    end
  end
  # rubocop:enable Metrics/CyclomaticComplexity
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
simple_cov-formatter-terminal-1.7.0 lib/simple_cov/formatter/terminal/color_printing.rb
simple_cov-formatter-terminal-1.6.0 lib/simple_cov/formatter/terminal/color_printing.rb
simple_cov-formatter-terminal-1.5.0 lib/simple_cov/formatter/terminal/color_printing.rb
simple_cov-formatter-terminal-1.4.0 lib/simple_cov/formatter/terminal/color_printing.rb
simple_cov-formatter-terminal-1.3.0 lib/simple_cov/formatter/terminal/color_printing.rb
simple_cov-formatter-terminal-1.2.0 lib/simple_cov/formatter/terminal/color_printing.rb
simple_cov-formatter-terminal-1.1.0 lib/simple_cov/formatter/terminal/color_printing.rb
simple_cov-formatter-terminal-1.0.0 lib/simple_cov/formatter/terminal/color_printing.rb
simple_cov-formatter-terminal-0.3.1 lib/simple_cov/formatter/terminal/color_printing.rb
simple_cov-formatter-terminal-0.3.0 lib/simple_cov/formatter/terminal/color_printing.rb
simple_cov-formatter-terminal-0.2.4 lib/simple_cov/formatter/terminal/color_printing.rb
simple_cov-formatter-terminal-0.2.3 lib/simple_cov/formatter/terminal/color_printing.rb
simple_cov-formatter-terminal-0.2.2 lib/simple_cov/formatter/terminal/color_printing.rb
simple_cov-formatter-terminal-0.2.1 lib/simple_cov/formatter/terminal/color_printing.rb
simple_cov-formatter-terminal-0.2.0 lib/simple_cov/formatter/terminal/color_printing.rb
simple_cov-formatter-terminal-0.1.0 lib/simple_cov/formatter/terminal/color_printing.rb