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
- #bold(text) ⇒ Object
- #cross ⇒ Object
- #display_config_errors(errors) ⇒ Object
- #downwards_arrow_to_right ⇒ Object
- #faint(text) ⇒ Object
- #green(text) ⇒ Object
- #green_check ⇒ Object
- #red(text) ⇒ Object
- #yellow(text) ⇒ Object
Instance Method Details
#bold(text) ⇒ Object
16 17 18 |
# File 'lib/envirobly/colorize.rb', line 16 def bold(text) [ BOLD, text, RESET ].join end |
#cross ⇒ Object
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_right ⇒ Object
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_check ⇒ Object
32 33 34 |
# File 'lib/envirobly/colorize.rb', line 32 def green_check green("✔") end |