You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
306 B

5 months ago
  1. require_relative 'ansi_colors'
  2. # gather common definitions and functions
  3. class AnsiCommon
  4. def self.ansi_trace(trace)
  5. match = trace.match(/(↳ )?(.*:\d+):in `(.*)'/)
  6. return trace unless match
  7. _, m2, m3 = match.captures
  8. "#{m2} #{AnsiColors::BOLD}#{m3}#{AnsiColors::CLEAR}"
  9. end
  10. end