Module: Trailblazer::Developer::Wtf::Renderer::String

Defined in:
lib/trailblazer/developer/wtf/renderer.rb

Overview

Stolen from stackoverflow.com/questions/1489183/colorized-ruby-output

TODO: this is just prototyping

Class Method Summary collapse

Class Method Details

.bg_black(str) ⇒ Object



66
# File 'lib/trailblazer/developer/wtf/renderer.rb', line 66

def bg_black(str);       "\e[40m#{str}\e[0m" end

.bg_blue(str) ⇒ Object



70
# File 'lib/trailblazer/developer/wtf/renderer.rb', line 70

def bg_blue(str);        "\e[44m#{str}\e[0m" end

.bg_brown(str) ⇒ Object



69
# File 'lib/trailblazer/developer/wtf/renderer.rb', line 69

def bg_brown(str);       "\e[43m#{str}\e[0m" end

.bg_cyan(str) ⇒ Object



72
# File 'lib/trailblazer/developer/wtf/renderer.rb', line 72

def bg_cyan(str);        "\e[46m#{str}\e[0m" end

.bg_gray(str) ⇒ Object



73
# File 'lib/trailblazer/developer/wtf/renderer.rb', line 73

def bg_gray(str);        "\e[47m#{str}\e[0m" end

.bg_green(str) ⇒ Object



68
# File 'lib/trailblazer/developer/wtf/renderer.rb', line 68

def bg_green(str);       "\e[42m#{str}\e[0m" end

.bg_magenta(str) ⇒ Object



71
# File 'lib/trailblazer/developer/wtf/renderer.rb', line 71

def bg_magenta(str);     "\e[45m#{str}\e[0m" end

.bg_red(str) ⇒ Object



67
# File 'lib/trailblazer/developer/wtf/renderer.rb', line 67

def bg_red(str);         "\e[41m#{str}\e[0m" end

.black(str) ⇒ Object



57
# File 'lib/trailblazer/developer/wtf/renderer.rb', line 57

def black(str);          "\e[30m#{str}\e[0m" end

.blue(str) ⇒ Object



61
# File 'lib/trailblazer/developer/wtf/renderer.rb', line 61

def blue(str);           "\e[34m#{str}\e[0m" end

.bold(str) ⇒ Object



75
# File 'lib/trailblazer/developer/wtf/renderer.rb', line 75

def bold(str);           "\e[1m#{str}\e[22m" end

.brown(str) ⇒ Object



60
# File 'lib/trailblazer/developer/wtf/renderer.rb', line 60

def brown(str);          "\e[33m#{str}\e[0m" end

.cyan(str) ⇒ Object



63
# File 'lib/trailblazer/developer/wtf/renderer.rb', line 63

def cyan(str);           "\e[36m#{str}\e[0m" end

.gray(str) ⇒ Object



64
# File 'lib/trailblazer/developer/wtf/renderer.rb', line 64

def gray(str);           "\e[37m#{str}\e[0m" end

.green(str) ⇒ Object



59
# File 'lib/trailblazer/developer/wtf/renderer.rb', line 59

def green(str);          "\e[32m#{str}\e[0m" end

.italic(str) ⇒ Object



76
# File 'lib/trailblazer/developer/wtf/renderer.rb', line 76

def italic(str);         "\e[3m#{str}\e[23m" end

.magenta(str) ⇒ Object



62
# File 'lib/trailblazer/developer/wtf/renderer.rb', line 62

def magenta(str);        "\e[35m#{str}\e[0m" end

.red(str) ⇒ Object



58
# File 'lib/trailblazer/developer/wtf/renderer.rb', line 58

def red(str);            "\e[31m#{str}\e[0m" end

.underline(str) ⇒ Object



77
# File 'lib/trailblazer/developer/wtf/renderer.rb', line 77

def underline(str);      "\e[4m#{str}\e[24m" end