lib/roda/plugins/exception_page.rb in roda-3.29.0 vs lib/roda/plugins/exception_page.rb in roda-3.30.0
- old
+ new
@@ -242,14 +242,14 @@
"<script type=\"text/javascript\" src=\"#{h js_file}\"></script>"
end
frames = exception.backtrace.map.with_index do |line, i|
frame = {:id=>i}
- if line =~ /(.*?):(\d+)(:in `(.*)')?/
+ if line =~ /\A(.*?):(\d+)(?::in `(.*)')?\Z/
filename = frame[:filename] = $1
lineno = frame[:lineno] = $2.to_i
- frame[:function] = $4
+ frame[:function] = $3
begin
lineno -= 1
lines = ::File.readlines(filename)
pre_lineno = frame[:pre_context_lineno] = [lineno-context, 0].max
@@ -259,11 +259,9 @@
frame[:post_context] = lines[lineno+1..post_lineno]
rescue
end
frame
- else
- nil
end
end.compact
r = @_request
begin