| Class | Uttk::PathFilters::ColorStatus |
| In: |
lib/uttk/path_filters/ColorStatus.rb
|
| Parent: | PathFilter |
| STYLE | = | { :PASS => [:green], :FAIL => [:red], :ABORT => [:magenta], :SKIP => [:yellow], :ERROR => [:bold, :red] |
# File lib/uttk/path_filters/ColorStatus.rb, line 22 def initialize ( *a, &b ) raise "HighLine is unavailable" unless defined? HighLine @h = HighLine.new super end
# File lib/uttk/path_filters/ColorStatus.rb, line 38 def color ( str ) if str =~ /^([A-Z]+)(\(.*\))?$/ node = StyledString.new(@h.color(str, *STYLE[$1.to_sym]).to_s) else str end end