Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/rbcli/util/string_colorize.rb

Overview

RBCli – A framework for developing command line applications in Ruby #

Copyright (C) 2018 Andrew Khoury                                           #
                                                                           #
This program is free software: you can redistribute it and/or modify       #
it under the terms of the GNU General Public License as published by       #
the Free Software Foundation, either version 3 of the License, or          #
(at your option) any later version.                                        #
                                                                           #
This program is distributed in the hope that it will be useful,            #
but WITHOUT ANY WARRANTY; without even the implied warranty of             #
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              #
GNU General Public License for more details.                               #
                                                                           #
You should have received a copy of the GNU General Public License          #
along with this program.  If not, see <https://www.gnu.org/licenses/>.     #
                                                                           #
For questions regarding licensing, please contact [email protected]       #

Instance Method Summary collapse

Instance Method Details

#bg_blackObject



31
# File 'lib/rbcli/util/string_colorize.rb', line 31

def bg_black;       "\e[40m#{self}\e[0m" end

#bg_blueObject



35
# File 'lib/rbcli/util/string_colorize.rb', line 35

def bg_blue;        "\e[44m#{self}\e[0m" end

#bg_brownObject



34
# File 'lib/rbcli/util/string_colorize.rb', line 34

def bg_brown;       "\e[43m#{self}\e[0m" end

#bg_cyanObject



37
# File 'lib/rbcli/util/string_colorize.rb', line 37

def bg_cyan;        "\e[46m#{self}\e[0m" end

#bg_grayObject



38
# File 'lib/rbcli/util/string_colorize.rb', line 38

def bg_gray;        "\e[47m#{self}\e[0m" end

#bg_greenObject



33
# File 'lib/rbcli/util/string_colorize.rb', line 33

def bg_green;       "\e[42m#{self}\e[0m" end

#bg_magentaObject



36
# File 'lib/rbcli/util/string_colorize.rb', line 36

def bg_magenta;     "\e[45m#{self}\e[0m" end

#bg_redObject



32
# File 'lib/rbcli/util/string_colorize.rb', line 32

def bg_red;         "\e[41m#{self}\e[0m" end

#blackObject



22
# File 'lib/rbcli/util/string_colorize.rb', line 22

def black;          "\e[30m#{self}\e[0m" end


43
# File 'lib/rbcli/util/string_colorize.rb', line 43

def blink;          "\e[5m#{self}\e[25m" end

#blueObject



26
# File 'lib/rbcli/util/string_colorize.rb', line 26

def blue;           "\e[34m#{self}\e[0m" end

#boldObject



40
# File 'lib/rbcli/util/string_colorize.rb', line 40

def bold;           "\e[1m#{self}\e[22m" end

#brownObject



25
# File 'lib/rbcli/util/string_colorize.rb', line 25

def brown;          "\e[33m#{self}\e[0m" end

#cyanObject



28
# File 'lib/rbcli/util/string_colorize.rb', line 28

def cyan;           "\e[36m#{self}\e[0m" end

#grayObject



29
# File 'lib/rbcli/util/string_colorize.rb', line 29

def gray;           "\e[37m#{self}\e[0m" end

#greenObject



24
# File 'lib/rbcli/util/string_colorize.rb', line 24

def green;          "\e[32m#{self}\e[0m" end

#italicObject



41
# File 'lib/rbcli/util/string_colorize.rb', line 41

def italic;         "\e[3m#{self}\e[23m" end

#magentaObject



27
# File 'lib/rbcli/util/string_colorize.rb', line 27

def magenta;        "\e[35m#{self}\e[0m" end

#redObject



23
# File 'lib/rbcli/util/string_colorize.rb', line 23

def red;            "\e[31m#{self}\e[0m" end

#reverse_colorObject



44
# File 'lib/rbcli/util/string_colorize.rb', line 44

def reverse_color;  "\e[7m#{self}\e[27m" end

#underlineObject



42
# File 'lib/rbcli/util/string_colorize.rb', line 42

def underline;      "\e[4m#{self}\e[24m" end