Module: Paintbucket
- Defined in:
- lib/paintbucket/paintbucket.rb
Instance Method Summary collapse
- #paint(text, color_code) ⇒ Object
- #paint_divider(char, times) ⇒ Object
- #paint_error(msg) ⇒ Object
- #paint_header(msg) ⇒ Object
- #paint_hint(msg) ⇒ Object
- #paint_success(msg) ⇒ Object
- #paint_warn(msg) ⇒ Object
Instance Method Details
#paint(text, color_code) ⇒ Object
24 25 26 |
# File 'lib/paintbucket/paintbucket.rb', line 24 def paint(text, color_code) "\033[#{color_code}m#{text}\033[0m" end |
#paint_divider(char, times) ⇒ Object
50 51 52 |
# File 'lib/paintbucket/paintbucket.rb', line 50 def paint_divider(char, times) puts "\n#{paint_cyan(char * times)}" end |
#paint_error(msg) ⇒ Object
42 43 44 |
# File 'lib/paintbucket/paintbucket.rb', line 42 def paint_error(msg) puts "\n#{paint(" ✗ #{msg}", 31)}" end |
#paint_header(msg) ⇒ Object
54 55 56 |
# File 'lib/paintbucket/paintbucket.rb', line 54 def paint_header(msg) puts "\n#{paint_cyan(msg)}\n\n" end |
#paint_hint(msg) ⇒ Object
34 35 36 |
# File 'lib/paintbucket/paintbucket.rb', line 34 def paint_hint(msg) puts paint_black(" #{msg}") end |
#paint_success(msg) ⇒ Object
46 47 48 |
# File 'lib/paintbucket/paintbucket.rb', line 46 def paint_success(msg) puts "\n#{paint(" ✓ #{msg}", 32)}" end |
#paint_warn(msg) ⇒ Object
38 39 40 |
# File 'lib/paintbucket/paintbucket.rb', line 38 def paint_warn(msg) puts paint_yellow(" ⚑ " + msg) end |