class Trackets::Backtrace

Attributes

backtrace[R]

Public Class Methods

new(backtrace) click to toggle source
# File lib/trackets/backtrace.rb, line 6
def initialize(backtrace)
  @backtrace = backtrace
end

Public Instance Methods

parse() click to toggle source
# File lib/trackets/backtrace.rb, line 10
def parse
  backtrace.map do |line|
    next if line =~ %r{lib/trackets}

    line.sub!(Trackets.configuration.project_root, "[PROJECT_ROOT]") if Trackets.configuration.project_root

    if defined?(Gem)
      Gem.path.inject(line) { |current, path| current.sub(path, "[GEM_ROOT]") }
    end
  end.compact
end