Handles backtrace parsing line by line
regexp (optionnally allowing leading X: for windows support)
The file portion of the line (such as app/models/user.rb)
The method of the line (such as index)
The line number portion of the line
# File lib/hoptoad_notifier/backtrace.rb, line 28 def initialize(file, number, method) self.file = file self.number = number self.method = method end
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/hoptoad_notifier/backtrace.rb, line 23 def self.parse(unparsed_line) _, file, number, method = unparsed_line.match(INPUT_FORMAT).to_a new(file, number, method) end
# File lib/hoptoad_notifier/backtrace.rb, line 39 def ==(other) to_s == other.to_s end
# File lib/hoptoad_notifier/backtrace.rb, line 43 def inspect "<Line:#{to_s}>" end
Reconstructs the line in a readable fashion
# File lib/hoptoad_notifier/backtrace.rb, line 35 def to_s "#{file}:#{number}:in `#{method}'" end