Module: Jupiter::Cli::Colorizer

Extended by:
Colorizer
Included in:
Colorizer
Defined in:
lib/jupiter/cli/colorizer.rb

Instance Method Summary collapse

Instance Method Details

#color(color, text) ⇒ Object



24
25
26
# File 'lib/jupiter/cli/colorizer.rb', line 24

def color(color, text)
  public_send(color, text)
end

#color_mapObject



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/jupiter/cli/colorizer.rb', line 6

def color_map
  {
    red:      31,
    white:    37,
    yellow:   33,
    blue:     34,
    green:    32,
    cyan:     36,
    magenta:  35,
  }
end

#colorize(text, color_code) ⇒ Object



28
29
30
# File 'lib/jupiter/cli/colorizer.rb', line 28

def colorize(text, color_code)
  "\e[#{color_code}m#{text}\e[0m"
end