Module: Quorum::Helpers::Colors

Included in:
Generators::InstallGenerator
Defined in:
lib/quorum/helpers.rb

Overview

Colorize console text.

Instance Method Summary collapse

Instance Method Details

#blue(text) ⇒ Object

Blue



74
75
76
# File 'lib/quorum/helpers.rb', line 74

def blue(text)
  color(text, "\e[34m")
end

#bold(text) ⇒ Object

Bold



32
33
34
# File 'lib/quorum/helpers.rb', line 32

def bold(text)
  color(text, "\e[1m")
end

#color(text, color_code) ⇒ Object

Main color method.



25
26
27
# File 'lib/quorum/helpers.rb', line 25

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

#green(text) ⇒ Object

Green



46
47
48
# File 'lib/quorum/helpers.rb', line 46

def green(text)
  color(text, "\e[32m")
end

#grey(text) ⇒ Object

Grey



81
82
83
# File 'lib/quorum/helpers.rb', line 81

def grey(text)
  color(text, "\e[90m")
end

#magenta(text) ⇒ Object

Magenta



60
61
62
# File 'lib/quorum/helpers.rb', line 60

def magenta(text)
  color(text, "\e[35m")
end

#red(text) ⇒ Object

Red



53
54
55
# File 'lib/quorum/helpers.rb', line 53

def red(text)
  color(text, "\e[31m")
end

#white(text) ⇒ Object

White



39
40
41
# File 'lib/quorum/helpers.rb', line 39

def white(text)
  color(text, "\e[37m")
end

#yellow(text) ⇒ Object

Yellow



67
68
69
# File 'lib/quorum/helpers.rb', line 67

def yellow(text)
  color(text, "\e[33m")
end