Module: Kernel
- Includes:
- Term::ANSIColour
- Defined in:
- lib/rcl/ext/ansicolour.rb
Instance Method Summary collapse
- #orig_print ⇒ Object
-
#print(str) ⇒ Object
alias_method :orig_puts, :puts # XXX - still has issues passing a list.
Methods included from Term::ANSIColour
Instance Method Details
#orig_print ⇒ Object
115 |
# File 'lib/rcl/ext/ansicolour.rb', line 115 alias_method :orig_print, :print |
#print(str) ⇒ Object
alias_method :orig_puts, :puts # XXX - still has issues passing a list
118 119 120 121 122 123 124 |
# File 'lib/rcl/ext/ansicolour.rb', line 118 def print(str) colours = Term::ANSIColour.colour attr = Term::ANSIColour.attributes orig_print ( attr[colours[0]] == 0 ? str : colours.map{|c| "\e\[#{attr[c]}m"}.join + str + "\e\[#{attr['reset']}m" ) end |