Module: AnsiHelp
- Included in:
- ReportDiffer
- Defined in:
- lib/report/report_differ.rb
Instance Method Summary collapse
- #ansi(code, text) ⇒ Object
- #bold(text) ⇒ Object
- #green(text) ⇒ Object
- #greenbg(text) ⇒ Object
- #noattrs(text) ⇒ Object
- #red(text) ⇒ Object
- #redbg(text) ⇒ Object
- #white(text) ⇒ Object
- #yellow(text) ⇒ Object
Instance Method Details
#ansi(code, text) ⇒ Object
4 5 6 |
# File 'lib/report/report_differ.rb', line 4 def ansi(code, text) "\033[#{code}m#{text}\033[0m" end |
#bold(text) ⇒ Object
8 |
# File 'lib/report/report_differ.rb', line 8 def bold(text); ansi(1,text); end |
#green(text) ⇒ Object
10 |
# File 'lib/report/report_differ.rb', line 10 def green(text); ansi(32,text); end |
#greenbg(text) ⇒ Object
14 |
# File 'lib/report/report_differ.rb', line 14 def greenbg(text); ansi(42,text); end |
#noattrs(text) ⇒ Object
7 |
# File 'lib/report/report_differ.rb', line 7 def noattrs(text); ansi(0,text); end |
#red(text) ⇒ Object
9 |
# File 'lib/report/report_differ.rb', line 9 def red(text); ansi(31,text); end |
#redbg(text) ⇒ Object
13 |
# File 'lib/report/report_differ.rb', line 13 def redbg(text); ansi(41,text); end |
#white(text) ⇒ Object
12 |
# File 'lib/report/report_differ.rb', line 12 def white(text); ansi(37,text); end |
#yellow(text) ⇒ Object
11 |
# File 'lib/report/report_differ.rb', line 11 def yellow(text); ansi(33,text); end |