Module: RubyNodeReflector::Coulor
- Included in:
- RubyReflector
- Defined in:
- lib/ruby_reflector.rb
Overview
:nodoc:
Constant Summary collapse
- BOLD =
"\e[1m"
- CLEAR =
"\e[0m"
Instance Method Summary collapse
- #blue(text) ⇒ Object
- #bold(text) ⇒ Object
- #colorize(we_color) ⇒ Object
-
#colorize? ⇒ Boolean
ERGO how other libraries set these options transparent??.
-
#colour(text, colour_code) ⇒ Object
ERGO modularize these; anneal with Win32.
- #green(text) ⇒ Object
- #magenta(text) ⇒ Object
- #orange(text) ⇒ Object
- #red(text) ⇒ Object
Instance Method Details
#blue(text) ⇒ Object
95 |
# File 'lib/ruby_reflector.rb', line 95 def blue(text); colour(text, "\e[34m"); end |
#bold(text) ⇒ Object
88 89 90 91 |
# File 'lib/ruby_reflector.rb', line 88 def bold(text) return BOLD + text + CLEAR if colorize? return text end |
#colorize(we_color) ⇒ Object
73 74 75 |
# File 'lib/ruby_reflector.rb', line 73 def colorize(we_color) @@we_color = we_color end |
#colorize? ⇒ Boolean
ERGO how other libraries set these options transparent??
84 85 86 87 |
# File 'lib/ruby_reflector.rb', line 84 def colorize? # ERGO how other libraries set these options transparent?? we_color = (@@we_color rescue true ) # ERGO parens needed? return (we_color == :always or we_color && $stdout.tty?) end |
#colour(text, colour_code) ⇒ Object
ERGO modularize these; anneal with Win32
80 81 82 83 |
# File 'lib/ruby_reflector.rb', line 80 def colour(text, colour_code) return colour_code + text + CLEAR if colorize? return text end |
#green(text) ⇒ Object
92 |
# File 'lib/ruby_reflector.rb', line 92 def green(text); colour(text, "\e[32m"); end |
#magenta(text) ⇒ Object
94 |
# File 'lib/ruby_reflector.rb', line 94 def magenta(text); colour(text, "\e[35m"); end |
#orange(text) ⇒ Object
96 |
# File 'lib/ruby_reflector.rb', line 96 def orange(text); colour(text, "\e[3Bm"); end |
#red(text) ⇒ Object
93 |
# File 'lib/ruby_reflector.rb', line 93 def red(text); colour(text, "\e[31m"); end |