Module: GodOfWar::Extensions::Core::String
- Defined in:
- lib/godofwar/extensions.rb
Instance Method Summary collapse
- #blue ⇒ Object
- #bold ⇒ Object
- #colorize(text, color_code) ⇒ Object
- #cyan ⇒ Object
- #dark_blue ⇒ Object
- #dark_cyan ⇒ Object
- #dark_green ⇒ Object
- #dark_purple ⇒ Object
- #done ⇒ Object
- #error ⇒ Object
- #green ⇒ Object
- #pure ⇒ Object
- #purple ⇒ Object
- #red ⇒ Object
- #step_fail ⇒ Object
- #step_success ⇒ Object
- #success ⇒ Object
- #tell ⇒ Object
- #underline ⇒ Object
- #warn ⇒ Object
- #yellow ⇒ Object
Instance Method Details
#blue ⇒ Object
9 |
# File 'lib/godofwar/extensions.rb', line 9 def blue; colorize(self, "\e[1m\e[34m"); end |
#bold ⇒ Object
17 |
# File 'lib/godofwar/extensions.rb', line 17 def bold; colorize(self, "\e[1m"); end |
#colorize(text, color_code) ⇒ Object
25 |
# File 'lib/godofwar/extensions.rb', line 25 def colorize(text, color_code) "#{color_code}#{text}\e[0m" end |
#cyan ⇒ Object
13 |
# File 'lib/godofwar/extensions.rb', line 13 def cyan; colorize(self, "\e[1;36m"); end |
#dark_blue ⇒ Object
10 |
# File 'lib/godofwar/extensions.rb', line 10 def dark_blue; colorize(self, "\e[34m"); end |
#dark_cyan ⇒ Object
14 |
# File 'lib/godofwar/extensions.rb', line 14 def dark_cyan; colorize(self, "\e[36m"); end |
#dark_green ⇒ Object
7 |
# File 'lib/godofwar/extensions.rb', line 7 def dark_green; colorize(self, "\e[32m"); end |
#dark_purple ⇒ Object
12 |
# File 'lib/godofwar/extensions.rb', line 12 def dark_purple; colorize(self, "\e[1;35m"); end |
#done ⇒ Object
24 |
# File 'lib/godofwar/extensions.rb', line 24 def done; colorize(self, "[" + " ✔ ".green + "] "); end |
#error ⇒ Object
19 |
# File 'lib/godofwar/extensions.rb', line 19 def error; colorize(self, "[" + " ✖ ".red + "] "); end |
#green ⇒ Object
6 |
# File 'lib/godofwar/extensions.rb', line 6 def green; colorize(self, "\e[1m\e[32m"); end |
#pure ⇒ Object
15 |
# File 'lib/godofwar/extensions.rb', line 15 def pure; colorize(self, "\e[0m\e[28m"); end |
#purple ⇒ Object
11 |
# File 'lib/godofwar/extensions.rb', line 11 def purple; colorize(self, "\e[35m"); end |
#red ⇒ Object
5 |
# File 'lib/godofwar/extensions.rb', line 5 def red; colorize(self, "\e[1m\e[31m"); end |
#step_fail ⇒ Object
23 |
# File 'lib/godofwar/extensions.rb', line 23 def step_fail; colorize(self, " ✖ ".dark_green); end |
#step_success ⇒ Object
22 |
# File 'lib/godofwar/extensions.rb', line 22 def step_success; colorize(self, " ✔ ".dark_green); end |
#success ⇒ Object
21 |
# File 'lib/godofwar/extensions.rb', line 21 def success; colorize(self, "[" + " ✔ ".dark_green + "] "); end |
#tell ⇒ Object
18 |
# File 'lib/godofwar/extensions.rb', line 18 def tell; colorize(self, "[" + " ℹ " + "] "); end |
#underline ⇒ Object
16 |
# File 'lib/godofwar/extensions.rb', line 16 def underline; colorize(self, "\e[4m"); end |
#warn ⇒ Object
20 |
# File 'lib/godofwar/extensions.rb', line 20 def warn; colorize(self, "[" + " ! ".bold.yellow + "] "); end |
#yellow ⇒ Object
8 |
# File 'lib/godofwar/extensions.rb', line 8 def yellow; colorize(self, "\e[1m\e[33m"); end |