Module: Envirobly::Colorize

Included in:
AccessToken, Envirobly::Cli::Main, Defaults::Account, Defaults::Region, Deployment, Duration
Defined in:
lib/envirobly/colorize.rb

Constant Summary collapse

GREEN =
"\e[32m"
RED =
"\e[31m"
YELLOW =
"\e[33m"
BLUE =
"\e[34m"
RESET =
"\e[0m"
BOLD =
"\e[1m"
FAINT =
"\e[2m"

Instance Method Summary collapse

Instance Method Details

#bold(text) ⇒ Object



16
17
18
# File 'lib/envirobly/colorize.rb', line 16

def bold(text)
  [ BOLD, text, RESET ].join
end

#crossObject



40
41
42
# File 'lib/envirobly/colorize.rb', line 40

def cross
  ""
end

#display_config_errors(errors) ⇒ Object



44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/envirobly/colorize.rb', line 44

def display_config_errors(errors)
  puts "#{red(cross)} Config contains the following issues:"

  errors.each do |error|
    puts
    puts "  #{error["message"]}"

    if error["path"]
      puts faint("  #{downwards_arrow_to_right} #{error["path"]}")
    end
  end
end

#downwards_arrow_to_rightObject



36
37
38
# File 'lib/envirobly/colorize.rb', line 36

def downwards_arrow_to_right
  ""
end

#faint(text) ⇒ Object



12
13
14
# File 'lib/envirobly/colorize.rb', line 12

def faint(text)
  [ FAINT, text, RESET ].join
end

#green(text) ⇒ Object



20
21
22
# File 'lib/envirobly/colorize.rb', line 20

def green(text)
  [ GREEN, text, RESET ].join
end

#green_checkObject



32
33
34
# File 'lib/envirobly/colorize.rb', line 32

def green_check
  green("")
end

#red(text) ⇒ Object



28
29
30
# File 'lib/envirobly/colorize.rb', line 28

def red(text)
  [ RED, text, RESET ].join
end

#yellow(text) ⇒ Object



24
25
26
# File 'lib/envirobly/colorize.rb', line 24

def yellow(text)
  [ YELLOW, text, RESET ].join
end