Module: Karafka::Helpers::Colorize
- Included in:
- Cli::Base, Cli::Install, Cli::Topics, Cli::Topics::Base
- Defined in:
- lib/karafka/helpers/colorize.rb
Overview
Simple wrapper for adding colors to strings
Instance Method Summary collapse
-
#green(string) ⇒ String
Green string.
-
#grey(string) ⇒ String
Grey string.
-
#red(string) ⇒ String
Red string.
-
#yellow(string) ⇒ String
Yellow string.
Instance Method Details
#green(string) ⇒ String
Returns green string.
9 10 11 |
# File 'lib/karafka/helpers/colorize.rb', line 9 def green(string) "\033[0;32m#{string}\033[0m" end |
#grey(string) ⇒ String
Returns grey string.
27 28 29 |
# File 'lib/karafka/helpers/colorize.rb', line 27 def grey(string) "\e[38;5;244m#{string}\e[0m" end |
#red(string) ⇒ String
Returns red string.
15 16 17 |
# File 'lib/karafka/helpers/colorize.rb', line 15 def red(string) "\033[0;31m#{string}\033[0m" end |
#yellow(string) ⇒ String
Returns yellow string.
21 22 23 |
# File 'lib/karafka/helpers/colorize.rb', line 21 def yellow(string) "\033[1;33m#{string}\033[0m" end |