Class: String
- Inherits:
-
Object
- Object
- String
- 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
- #bg_black ⇒ Object
- #bg_blue ⇒ Object
- #bg_brown ⇒ Object
- #bg_cyan ⇒ Object
- #bg_gray ⇒ Object
- #bg_green ⇒ Object
- #bg_magenta ⇒ Object
- #bg_red ⇒ Object
- #black ⇒ Object
- #blink ⇒ Object
- #blue ⇒ Object
- #bold ⇒ Object
- #brown ⇒ Object
- #cyan ⇒ Object
- #gray ⇒ Object
- #green ⇒ Object
- #italic ⇒ Object
- #magenta ⇒ Object
- #red ⇒ Object
- #reverse_color ⇒ Object
- #underline ⇒ Object
Instance Method Details
#bg_black ⇒ Object
31 |
# File 'lib/rbcli/util/string_colorize.rb', line 31 def bg_black; "\e[40m#{self}\e[0m" end |
#bg_blue ⇒ Object
35 |
# File 'lib/rbcli/util/string_colorize.rb', line 35 def bg_blue; "\e[44m#{self}\e[0m" end |
#bg_brown ⇒ Object
34 |
# File 'lib/rbcli/util/string_colorize.rb', line 34 def bg_brown; "\e[43m#{self}\e[0m" end |
#bg_cyan ⇒ Object
37 |
# File 'lib/rbcli/util/string_colorize.rb', line 37 def bg_cyan; "\e[46m#{self}\e[0m" end |
#bg_gray ⇒ Object
38 |
# File 'lib/rbcli/util/string_colorize.rb', line 38 def bg_gray; "\e[47m#{self}\e[0m" end |
#bg_green ⇒ Object
33 |
# File 'lib/rbcli/util/string_colorize.rb', line 33 def bg_green; "\e[42m#{self}\e[0m" end |
#bg_magenta ⇒ Object
36 |
# File 'lib/rbcli/util/string_colorize.rb', line 36 def bg_magenta; "\e[45m#{self}\e[0m" end |
#bg_red ⇒ Object
32 |
# File 'lib/rbcli/util/string_colorize.rb', line 32 def bg_red; "\e[41m#{self}\e[0m" end |
#black ⇒ Object
22 |
# File 'lib/rbcli/util/string_colorize.rb', line 22 def black; "\e[30m#{self}\e[0m" end |
#blink ⇒ Object
43 |
# File 'lib/rbcli/util/string_colorize.rb', line 43 def blink; "\e[5m#{self}\e[25m" end |
#blue ⇒ Object
26 |
# File 'lib/rbcli/util/string_colorize.rb', line 26 def blue; "\e[34m#{self}\e[0m" end |
#bold ⇒ Object
40 |
# File 'lib/rbcli/util/string_colorize.rb', line 40 def bold; "\e[1m#{self}\e[22m" end |
#brown ⇒ Object
25 |
# File 'lib/rbcli/util/string_colorize.rb', line 25 def brown; "\e[33m#{self}\e[0m" end |
#cyan ⇒ Object
28 |
# File 'lib/rbcli/util/string_colorize.rb', line 28 def cyan; "\e[36m#{self}\e[0m" end |
#gray ⇒ Object
29 |
# File 'lib/rbcli/util/string_colorize.rb', line 29 def gray; "\e[37m#{self}\e[0m" end |
#green ⇒ Object
24 |
# File 'lib/rbcli/util/string_colorize.rb', line 24 def green; "\e[32m#{self}\e[0m" end |
#italic ⇒ Object
41 |
# File 'lib/rbcli/util/string_colorize.rb', line 41 def italic; "\e[3m#{self}\e[23m" end |
#magenta ⇒ Object
27 |
# File 'lib/rbcli/util/string_colorize.rb', line 27 def magenta; "\e[35m#{self}\e[0m" end |
#red ⇒ Object
23 |
# File 'lib/rbcli/util/string_colorize.rb', line 23 def red; "\e[31m#{self}\e[0m" end |
#reverse_color ⇒ Object
44 |
# File 'lib/rbcli/util/string_colorize.rb', line 44 def reverse_color; "\e[7m#{self}\e[27m" end |
#underline ⇒ Object
42 |
# File 'lib/rbcli/util/string_colorize.rb', line 42 def underline; "\e[4m#{self}\e[24m" end |