Class: Massa::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/massa/cli.rb

Class Method Summary collapse

Class Method Details

.code(color) ⇒ Object



12
13
14
# File 'lib/massa/cli.rb', line 12

def code(color)
  { red: 31, green: 32, yellow: 33, blue: 34, pink: 35, light_blue: 36 }[color] || 0
end

.colorize(*args) ⇒ Object



6
7
8
9
10
# File 'lib/massa/cli.rb', line 6

def colorize(*args)
  print "\n"
  args.each_slice(2) { |color, string| print "\e[#{code(color)}m#{string}\e[0m" }
  print "\n"
end