class Raven::Backtrace::Line
Handles backtrace parsing line by line
Constants
- APP_DIRS_PATTERN
- INPUT_FORMAT
regexp (optionnally allowing leading X: for windows support)
Attributes
file[RW]
The file portion of the line (such as app/models/user.rb)
method[RW]
The method of the line (such as index)
number[RW]
The line number portion of the line
Public Class Methods
new(file, number, method)
click to toggle source
# File lib/raven/backtrace.rb, line 33 def initialize(file, number, method) self.file = file self.number = number.to_i self.method = method end
parse(unparsed_line)
click to toggle source
Parses a single line of a given backtrace @param [String] unparsed_line The raw line from caller
or some backtrace @return [Line] The parsed backtrace line
# File lib/raven/backtrace.rb, line 28 def self.parse(unparsed_line) _, file, number, method = unparsed_line.match(INPUT_FORMAT).to_a new(file, number, method) end
Public Instance Methods
==(other)
click to toggle source
# File lib/raven/backtrace.rb, line 59 def ==(other) to_s == other.to_s end
in_app()
click to toggle source
# File lib/raven/backtrace.rb, line 39 def in_app app_dirs = Raven.configuration.app_dirs_pattern || APP_DIRS_PATTERN @in_app_pattern ||= Regexp.new("^(#{project_root}/)?#{app_dirs}") if self.file =~ @in_app_pattern true else false end end
inspect()
click to toggle source
# File lib/raven/backtrace.rb, line 63 def inspect "<Line:#{to_s}>" end
project_root()
click to toggle source
# File lib/raven/backtrace.rb, line 50 def project_root @project_root ||= Raven.configuration.project_root && Raven.configuration.project_root.to_s end
to_s()
click to toggle source
Reconstructs the line in a readable fashion
# File lib/raven/backtrace.rb, line 55 def to_s "#{file}:#{number}:in `#{method}'" end