lib/raven/backtrace.rb in sentry-raven-2.3.0 vs lib/raven/backtrace.rb in sentry-raven-2.3.1
- old
+ new
@@ -3,12 +3,16 @@
module Raven
# Front end to parsing the backtrace for each notice
class Backtrace
# Handles backtrace parsing line by line
class Line
- # regexp (optionnally allowing leading X: for windows support)
- RUBY_INPUT_FORMAT = /^((?:[a-zA-Z]:)?[^:]+|<.*>):(\d+)(?::in `([^']+)')?$/
+ # regexp (optional leading X: on windows, or JRuby9000 class-prefix)
+ RUBY_INPUT_FORMAT = /
+ ^ \s* (?: [a-zA-Z]: | uri:classloader: )? ([^:]+ | <.*>):
+ (\d+)
+ (?: :in \s `([^']+)')?$
+ /x
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:170)
JAVA_INPUT_FORMAT = /^(.+)\.([^\.]+)\(([^\:]+)\:(\d+)\)$/
# The file portion of the line (such as app/models/user.rb)
@@ -28,9 +32,10 @@
# @return [Line] The parsed backtrace line
def self.parse(unparsed_line)
ruby_match = unparsed_line.match(RUBY_INPUT_FORMAT)
if ruby_match
_, file, number, method = ruby_match.to_a
+ file.sub!(/\.class$/, ".rb")
module_name = nil
else
java_match = unparsed_line.match(JAVA_INPUT_FORMAT)
_, module_name, method, file, number = java_match.to_a
end