Browse Source

origin taint when _ detected

main
pvincent 2 months ago
parent
commit
5cd485d30c
  1. 7
      lib/semantic/ansi_formatter.rb

7
lib/semantic/ansi_formatter.rb

@ -126,12 +126,15 @@ module Semantic
end end
def draw_fatal(char = CHAR_FATAL) = BG_MAGENTA + BOLD + TEXT_WHITE + char + CLEAR def draw_fatal(char = CHAR_FATAL) = BG_MAGENTA + BOLD + TEXT_WHITE + char + CLEAR
def origin = colorize(centerize(log.name), TEXT_CYAN)
def build_prefix(char) = "#{tags} #{origin}#{colorize(char)}" def build_prefix(char) = "#{tags} #{origin}#{colorize(char)}"
def build_terminus = "#{tags} #{origin} #{TERMINUS_STRING} " def build_terminus = "#{tags} #{origin} #{TERMINUS_STRING} "
def centerize(text, max_length = CENTER_SIZE) = text.reverse.truncate(max_length).reverse.center(max_length) def centerize(text, max_length = CENTER_SIZE) = text.reverse.truncate(max_length).reverse.center(max_length)
def origin
taint = log.name.include?('_') ? TEXT_GRAY_400 : TEXT_CYAN
colorize(centerize(log.name), taint)
end
def stackisize(items) def stackisize(items)
return '' if items.empty? return '' if items.empty?

Loading…
Cancel
Save