Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/pastie-api/console.rb
Instance Method Summary collapse
- #blue ⇒ Object
- #colorize(text, color_code) ⇒ Object
- #dark_blue ⇒ Object
- #dark_green ⇒ Object
- #green ⇒ Object
- #magenta ⇒ Object
- #purple ⇒ Object
- #red ⇒ Object
- #yellow ⇒ Object
Instance Method Details
#blue ⇒ Object
6 |
# File 'lib/pastie-api/console.rb', line 6 def blue; colorize(self, "\e[1m\e[34m"); end |
#colorize(text, color_code) ⇒ Object
10 |
# File 'lib/pastie-api/console.rb', line 10 def colorize(text, color_code) ; "#{color_code}#{text}\e[0m" ; end |
#dark_blue ⇒ Object
7 |
# File 'lib/pastie-api/console.rb', line 7 def dark_blue; colorize(self, "\e[34m"); end |
#dark_green ⇒ Object
4 |
# File 'lib/pastie-api/console.rb', line 4 def dark_green; colorize(self, "\e[32m"); end |
#green ⇒ Object
3 |
# File 'lib/pastie-api/console.rb', line 3 def green; colorize(self, "\e[1m\e[32m"); end |
#magenta ⇒ Object
9 |
# File 'lib/pastie-api/console.rb', line 9 def magenta; colorize(self, "\e[1m\e[36m"); end |
#purple ⇒ Object
8 |
# File 'lib/pastie-api/console.rb', line 8 def purple; colorize(self, "\e[1m\e[35m"); end |
#red ⇒ Object
2 |
# File 'lib/pastie-api/console.rb', line 2 def red; colorize(self, "\e[1m\e[31m"); end |
#yellow ⇒ Object
5 |
# File 'lib/pastie-api/console.rb', line 5 def yellow; colorize(self, "\e[1m\e[33m"); end |