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
90 |
# File 'lib/trailblazer/developer/wtf.rb', line 90 def bg_black(str); "\e[40m#{str}\e[0m" end |
.bg_blue(str) ⇒ Object
94 |
# File 'lib/trailblazer/developer/wtf.rb', line 94 def bg_blue(str); "\e[44m#{str}\e[0m" end |
.bg_brown(str) ⇒ Object
93 |
# File 'lib/trailblazer/developer/wtf.rb', line 93 def bg_brown(str); "\e[43m#{str}\e[0m" end |
.bg_cyan(str) ⇒ Object
96 |
# File 'lib/trailblazer/developer/wtf.rb', line 96 def bg_cyan(str); "\e[46m#{str}\e[0m" end |
.bg_gray(str) ⇒ Object
97 |
# File 'lib/trailblazer/developer/wtf.rb', line 97 def bg_gray(str); "\e[47m#{str}\e[0m" end |
.bg_green(str) ⇒ Object
92 |
# File 'lib/trailblazer/developer/wtf.rb', line 92 def bg_green(str); "\e[42m#{str}\e[0m" end |
.bg_magenta(str) ⇒ Object
95 |
# File 'lib/trailblazer/developer/wtf.rb', line 95 def bg_magenta(str); "\e[45m#{str}\e[0m" end |
.bg_red(str) ⇒ Object
91 |
# File 'lib/trailblazer/developer/wtf.rb', line 91 def bg_red(str); "\e[41m#{str}\e[0m" end |
.black(str) ⇒ Object
81 |
# File 'lib/trailblazer/developer/wtf.rb', line 81 def black(str); "\e[30m#{str}\e[0m" end |
.blink(str) ⇒ Object
102 |
# File 'lib/trailblazer/developer/wtf.rb', line 102 def blink(str); "\e[5m#{str}\e[25m" end |
.blue(str) ⇒ Object
85 |
# File 'lib/trailblazer/developer/wtf.rb', line 85 def blue(str); "\e[34m#{str}\e[0m" end |
.bold(str) ⇒ Object
99 |
# File 'lib/trailblazer/developer/wtf.rb', line 99 def bold(str); "\e[1m#{str}\e[22m" end |
.brown(str) ⇒ Object
84 |
# File 'lib/trailblazer/developer/wtf.rb', line 84 def brown(str); "\e[33m#{str}\e[0m" end |
.cyan(str) ⇒ Object
87 |
# File 'lib/trailblazer/developer/wtf.rb', line 87 def cyan(str); "\e[36m#{str}\e[0m" end |
.gray(str) ⇒ Object
88 |
# File 'lib/trailblazer/developer/wtf.rb', line 88 def gray(str); "\e[37m#{str}\e[0m" end |
.green(str) ⇒ Object
83 |
# File 'lib/trailblazer/developer/wtf.rb', line 83 def green(str); "\e[32m#{str}\e[0m" end |
.italic(str) ⇒ Object
100 |
# File 'lib/trailblazer/developer/wtf.rb', line 100 def italic(str); "\e[3m#{str}\e[23m" end |
.magenta(str) ⇒ Object
86 |
# File 'lib/trailblazer/developer/wtf.rb', line 86 def magenta(str); "\e[35m#{str}\e[0m" end |
.red(str) ⇒ Object
82 |
# File 'lib/trailblazer/developer/wtf.rb', line 82 def red(str); "\e[31m#{str}\e[0m" end |
.reverse_color(str) ⇒ Object
103 |
# File 'lib/trailblazer/developer/wtf.rb', line 103 def reverse_color(str); "\e[7m#{str}\e[27m" end |
.underline(str) ⇒ Object
101 |
# File 'lib/trailblazer/developer/wtf.rb', line 101 def underline(str); "\e[4m#{str}\e[24m" end |