class Cumulus::Colors

Public: Provides methods for creating strings with different colors in the console.

Public Class Methods

added(s) click to toggle source

Public: color format a string that describes an added resource

s - the string to format

Returns the formatted string

# File lib/util/Colors.rb, line 20
def self.added(s)
  self.green(s)
end
aws_changes(s) click to toggle source

Public: color format a string that describes the changes in AWS

s - the string to format

Returns the formatted string

# File lib/util/Colors.rb, line 47
def self.aws_changes(s)
  self.blue(s)
end
blue(s) click to toggle source

Public: Create a string that is blue.

s - the string to format

Returns the blue string

# File lib/util/Colors.rb, line 98
def self.blue(s)
  Colors.colorize(s, @@blue)
end
colorize(s, color) click to toggle source

Public: create a string that has a specific color. Will not output color if `colors_enabled` is set to false. This can be set in “configuration.json”

s - the string to format color - the color to use

Returns the formatted string

# File lib/util/Colors.rb, line 67
def self.colorize(s, color)
  if @@colors_enabled
    "#{color}#{s}#{@@no_color}"
  else
    s
  end
end
green(s) click to toggle source

Public: Create a string that is green.

s - the string to format

Returns the green string

# File lib/util/Colors.rb, line 89
def self.green(s)
  Colors.colorize(s, @@green)
end
local_changes(s) click to toggle source

Public: color format a string that describes the local changes

s - the string to format

Returns the formatted string

# File lib/util/Colors.rb, line 56
def self.local_changes(s)
  self.orange(s)
end
orange(s) click to toggle source

Public: Create a string that is orange.

s - the string to format

Returns the orange string

# File lib/util/Colors.rb, line 107
def self.orange(s)
  Colors.colorize(s, @@orange)
end
red(s) click to toggle source

Public: Create a string that is red.

s - the string to format

Returns the red string

# File lib/util/Colors.rb, line 80
def self.red(s)
  Colors.colorize(s, @@red)
end
removed(s) click to toggle source

Public: color format a string the describes a removed resource

s - the string to format

Returns the formatted string

# File lib/util/Colors.rb, line 38
def self.removed(s)
  self.red(s)
end
unmanaged(s) click to toggle source

Public: color format a string that describes an unmanaged resource

s - the string to format

Returns the formatted string

# File lib/util/Colors.rb, line 29
def self.unmanaged(s)
  self.red(s)
end