Module: Dry::CLI::Banner::ColorMethods Private

Extended by:
Forwardable
Included in:
Dry::CLI::Banner
Defined in:
lib/dry/cli/banner.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0

Defined Under Namespace

Classes: NoColorPastel

Constant Summary collapse

COLOR_METHODS =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0

%i[
  yellow
  green
  red
  blue
  magenta
  cyan
  white
  black
  gray
  bright_white
  bright_black
  bright_red
  bright_green
  bright_blue
  bright_magenta
  bright_cyan
  bright_gray
].freeze
DECORATIONS =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Pastel answers a colour two ways: yellow("text") decorates in one call, yellow.bold("text") returns a chain to decorate further. The colourless stand-in has to answer both shapes, so given text it hands the text straight back and given nothing it hands back itself.

Since:

  • 0.1.0

%i[bold dim italic underline inverse strikethrough blink].freeze

Instance Method Summary collapse

Instance Method Details

#pastelObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0



121
122
123
124
125
126
127
# File 'lib/dry/cli/banner.rb', line 121

def pastel
  @pastel ||= if Banner.color_enabled?
    Pastel.new
  else
    NoColorPastel.new
  end
end