Method: Sentry::StacktraceInterface::Frame#compute_filename

Defined in:
lib/sentry/interfaces/stacktrace.rb

#compute_filenameObject

[View source]

46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/sentry/interfaces/stacktrace.rb', line 46

def compute_filename
  return if abs_path.nil?
  return abs_path unless @strip_backtrace_load_path

  prefix =
    if under_project_root? && in_app
      @project_root
    elsif under_project_root?
      longest_load_path || @project_root
    else
      longest_load_path
    end

  prefix ? abs_path[prefix.to_s.chomp(File::SEPARATOR).length + 1..-1] : abs_path
end