Module: OCRunner::Console
- Included in:
- CLI, TestRunner
- Defined in:
- lib/ocrunner/console.rb
Instance Method Summary collapse
- #blue(text) ⇒ Object
- #colorize(text, color_code) ⇒ Object
- #green(text) ⇒ Object
- #indent(text = '') ⇒ Object
- #present(&block) ⇒ Object
- #red(text) ⇒ Object
Instance Method Details
#blue(text) ⇒ Object
11 |
# File 'lib/ocrunner/console.rb', line 11 def blue(text); colorize(text, "\033[34m"); end |
#colorize(text, color_code) ⇒ Object
5 6 7 |
# File 'lib/ocrunner/console.rb', line 5 def colorize(text, color_code) "#{color_code}#{text.to_s}\033[0m" end |
#green(text) ⇒ Object
10 |
# File 'lib/ocrunner/console.rb', line 10 def green(text); colorize(text, "\033[32m"); end |
#indent(text = '') ⇒ Object
13 14 15 |
# File 'lib/ocrunner/console.rb', line 13 def indent(text='') " " + text.to_s end |
#present(&block) ⇒ Object
16 17 18 19 20 |
# File 'lib/ocrunner/console.rb', line 16 def present(&block) puts yield puts end |
#red(text) ⇒ Object
9 |
# File 'lib/ocrunner/console.rb', line 9 def red(text); colorize(text, "\033[31m"); end |