pvincent
5 months ago
6 changed files with 31 additions and 29 deletions
-
3lib/formatters/ansi_colors.rb
-
14lib/formatters/ansi_common.rb
-
2lib/formatters/ansi_dimensions.rb
-
17lib/formatters/ansi_formatter.rb
-
18lib/formatters/ansi_wrapper.rb
-
6lib/hot_constants/live_constants.rb
@ -1,14 +0,0 @@ |
|||
require_relative 'ansi_colors' |
|||
|
|||
# gather common definitions and functions |
|||
class AnsiCommon |
|||
ANSI_REGEX = /\e\[[0-9;]*m/ # TODO: support for \x1b and \033 |
|||
|
|||
def self.ansi_trace(trace, symbol) |
|||
match = trace.match(/(↳ )?(.*:\d+)(:in `)?(.*'?)/) # only m2(=file) and m4(=optional function) are useful |
|||
return trace unless match |
|||
|
|||
_, m2, _, m4 = match.captures |
|||
"#{symbol} #{m2} #{AnsiColors::BOLD}#{m4.chop}#{AnsiColors::CLEAR}" |
|||
end |
|||
end |
Write
Preview
Loading…
Cancel
Save
Reference in new issue