From ae2427dde8d9fa1314020815232121d416f87eca Mon Sep 17 00:00:00 2001 From: pvincent Date: Sun, 8 Sep 2024 20:32:04 +0400 Subject: [PATCH] centerize from left side --- lib/semantic/ansi_formatter.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/semantic/ansi_formatter.rb b/lib/semantic/ansi_formatter.rb index 7536854..6d9ab6b 100644 --- a/lib/semantic/ansi_formatter.rb +++ b/lib/semantic/ansi_formatter.rb @@ -181,8 +181,8 @@ module Semantic def origin = colorize(centerize(log.name), TEXT_CYAN) def build_prefix(char) = "#{tags} #{origin} ╣#{colorize(char)}╠ " def build_terminus = "#{tags} #{origin} #{TERMINUS_STRING} " - def centerize(text) = text.truncate(CENTER_SIZE).center(CENTER_SIZE) def colorize(text, tint = color) = "#{tint}#{text}#{CLEAR}" + def centerize(text) = text.reverse.truncate(CENTER_SIZE).reverse.center(CENTER_SIZE) def stackisize(items) return '' if items.empty?