Top Level Namespace
Defined Under Namespace
Modules: Base, CommandLine, MerbAnalyzer, RailsAnalyzer Classes: ProgressBar, ReversedProgressBar
Instance Method Summary collapse
-
#blue(text) ⇒ Object
Draw a Yellow line of text.
-
#colorize(text, color_code, color = $arguments && $arguments[:colorize]) ⇒ Object
Colorize a text output with the given color if.
-
#green(text) ⇒ Object
Draw a Green line of text.
-
#red(text) ⇒ Object
Draw a red line of text.
- #white(text) ⇒ Object
-
#yellow(text) ⇒ Object
Draw a Yellow line of text.
Instance Method Details
#blue(text) ⇒ Object
Draw a Yellow line of text
25 26 27 |
# File 'lib/bashcolorizer.rb', line 25 def blue(text) colorize(text, "\e[34m") end |
#colorize(text, color_code, color = $arguments && $arguments[:colorize]) ⇒ Object
Colorize a text output with the given color if. text The text to colorize. color_code The color code string to set color Does not color if false. Defaults to ($arguments && $arguments)
5 6 7 |
# File 'lib/bashcolorizer.rb', line 5 def colorize(text, color_code, color = $arguments && $arguments[:colorize]) color ? "#{color_code}#{text}\e[0m" : text end |
#green(text) ⇒ Object
Draw a Green line of text
15 16 17 |
# File 'lib/bashcolorizer.rb', line 15 def green(text) colorize(text, "\e[32m") end |
#red(text) ⇒ Object
Draw a red line of text
10 11 12 |
# File 'lib/bashcolorizer.rb', line 10 def red(text) colorize(text, "\e[31m") end |
#white(text) ⇒ Object
29 30 31 |
# File 'lib/bashcolorizer.rb', line 29 def white(text) colorize(text, "\e[37m") end |
#yellow(text) ⇒ Object
Draw a Yellow line of text
20 21 22 |
# File 'lib/bashcolorizer.rb', line 20 def yellow(text) colorize(text, "\e[33m") end |