Module: Trailblazer::Developer::Wtf::String
- Defined in:
- lib/trailblazer/developer/wtf.rb
Overview
Stolen from stackoverflow.com/questions/1489183/colorized-ruby-output
TODO: this is just prototyping
Class Method Summary collapse
- .bg_black(str) ⇒ Object
- .bg_blue(str) ⇒ Object
- .bg_brown(str) ⇒ Object
- .bg_cyan(str) ⇒ Object
- .bg_gray(str) ⇒ Object
- .bg_green(str) ⇒ Object
- .bg_magenta(str) ⇒ Object
- .bg_red(str) ⇒ Object
- .black(str) ⇒ Object
- .blink(str) ⇒ Object
- .blue(str) ⇒ Object
- .bold(str) ⇒ Object
- .brown(str) ⇒ Object
- .cyan(str) ⇒ Object
- .gray(str) ⇒ Object
- .green(str) ⇒ Object
- .italic(str) ⇒ Object
- .magenta(str) ⇒ Object
- .red(str) ⇒ Object
- .reverse_color(str) ⇒ Object
- .underline(str) ⇒ Object
Class Method Details
.bg_black(str) ⇒ Object
77 |
# File 'lib/trailblazer/developer/wtf.rb', line 77 def bg_black(str); "\e[40m#{str}\e[0m" end |
.bg_blue(str) ⇒ Object
81 |
# File 'lib/trailblazer/developer/wtf.rb', line 81 def bg_blue(str); "\e[44m#{str}\e[0m" end |
.bg_brown(str) ⇒ Object
80 |
# File 'lib/trailblazer/developer/wtf.rb', line 80 def bg_brown(str); "\e[43m#{str}\e[0m" end |
.bg_cyan(str) ⇒ Object
83 |
# File 'lib/trailblazer/developer/wtf.rb', line 83 def bg_cyan(str); "\e[46m#{str}\e[0m" end |
.bg_gray(str) ⇒ Object
84 |
# File 'lib/trailblazer/developer/wtf.rb', line 84 def bg_gray(str); "\e[47m#{str}\e[0m" end |
.bg_green(str) ⇒ Object
79 |
# File 'lib/trailblazer/developer/wtf.rb', line 79 def bg_green(str); "\e[42m#{str}\e[0m" end |
.bg_magenta(str) ⇒ Object
82 |
# File 'lib/trailblazer/developer/wtf.rb', line 82 def bg_magenta(str); "\e[45m#{str}\e[0m" end |
.bg_red(str) ⇒ Object
78 |
# File 'lib/trailblazer/developer/wtf.rb', line 78 def bg_red(str); "\e[41m#{str}\e[0m" end |
.black(str) ⇒ Object
68 |
# File 'lib/trailblazer/developer/wtf.rb', line 68 def black(str); "\e[30m#{str}\e[0m" end |
.blink(str) ⇒ Object
89 |
# File 'lib/trailblazer/developer/wtf.rb', line 89 def blink(str); "\e[5m#{str}\e[25m" end |
.blue(str) ⇒ Object
72 |
# File 'lib/trailblazer/developer/wtf.rb', line 72 def blue(str); "\e[34m#{str}\e[0m" end |
.bold(str) ⇒ Object
86 |
# File 'lib/trailblazer/developer/wtf.rb', line 86 def bold(str); "\e[1m#{str}\e[22m" end |
.brown(str) ⇒ Object
71 |
# File 'lib/trailblazer/developer/wtf.rb', line 71 def brown(str); "\e[33m#{str}\e[0m" end |
.cyan(str) ⇒ Object
74 |
# File 'lib/trailblazer/developer/wtf.rb', line 74 def cyan(str); "\e[36m#{str}\e[0m" end |
.gray(str) ⇒ Object
75 |
# File 'lib/trailblazer/developer/wtf.rb', line 75 def gray(str); "\e[37m#{str}\e[0m" end |
.green(str) ⇒ Object
70 |
# File 'lib/trailblazer/developer/wtf.rb', line 70 def green(str); "\e[32m#{str}\e[0m" end |
.italic(str) ⇒ Object
87 |
# File 'lib/trailblazer/developer/wtf.rb', line 87 def italic(str); "\e[3m#{str}\e[23m" end |
.magenta(str) ⇒ Object
73 |
# File 'lib/trailblazer/developer/wtf.rb', line 73 def magenta(str); "\e[35m#{str}\e[0m" end |
.red(str) ⇒ Object
69 |
# File 'lib/trailblazer/developer/wtf.rb', line 69 def red(str); "\e[31m#{str}\e[0m" end |
.reverse_color(str) ⇒ Object
90 |
# File 'lib/trailblazer/developer/wtf.rb', line 90 def reverse_color(str); "\e[7m#{str}\e[27m" end |
.underline(str) ⇒ Object
88 |
# File 'lib/trailblazer/developer/wtf.rb', line 88 def underline(str); "\e[4m#{str}\e[24m" end |