|
|
@ -5,8 +5,6 @@ require 'json' |
|
|
|
module Semantic |
|
|
|
# wraps meanwhile takes care of ansi colors |
|
|
|
class FancyFormatter < AbstractFormatter |
|
|
|
TAG_NONE = ''.freeze |
|
|
|
CENTER_SIZE = 20 |
|
|
|
FOREMAN_PREFIX_LENGTH = 18 |
|
|
|
FAILOVER_WRAP = 80 |
|
|
|
CHAR_FATAL = '⯶'.freeze |
|
|
@ -52,17 +50,6 @@ module Semantic |
|
|
|
|
|
|
|
private |
|
|
|
|
|
|
|
def tags |
|
|
|
first_tag, taint = log.tags.empty? ? [TAG_NONE, CLEAR] : [log.tags.first, BG_GRAY + DARK_TEXT_YELLOW] |
|
|
|
colorize(centerize(first_tag, 10), taint) |
|
|
|
end |
|
|
|
|
|
|
|
def named_tags |
|
|
|
return if log.named_tags.empty? |
|
|
|
|
|
|
|
log.named_tags |
|
|
|
end |
|
|
|
|
|
|
|
def build_regex_redirected |
|
|
|
dev_port = Rails.application.routes.default_url_options[:port] |
|
|
|
dev_hosts = ['127.0.0.1', 'localhost', Rails.application.routes.default_url_options[:host]].uniq.join('|') |
|
|
@ -121,7 +108,6 @@ module Semantic |
|
|
|
def draw_fatal(char = CHAR_FATAL) = BG_MAGENTA + BOLD + TEXT_WHITE + char + CLEAR |
|
|
|
def build_prefix(char) = "#{tags} #{origin} ╣#{colorize(char)}╠ " |
|
|
|
def build_terminus = "#{tags} #{origin} #{TERMINUS_STRING} " |
|
|
|
def centerize(text, max_length = CENTER_SIZE) = text.reverse.truncate(max_length).reverse.center(max_length) |
|
|
|
|
|
|
|
def origin |
|
|
|
true_class = log.name == log.name.upcase_first |
|
|
|