Skip to content

Commit

Permalink
support ruby 3.4.0 style backtrace string
Browse files Browse the repository at this point in the history
  • Loading branch information
kuboon committed Jan 28, 2025
1 parent b75251b commit aa7a1a8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/solid_errors/backtrace_line.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module SolidErrors
# adapted from: https://github.com/honeybadger-io/honeybadger-ruby/blob/master/lib/honeybadger/backtrace.rb
class BacktraceLine
# Backtrace line regexp (optionally allowing leading X: for windows support).
INPUT_FORMAT = %r{^((?:[a-zA-Z]:)?[^:]+):(\d+)(?::in `([^']+)')?$}
INPUT_FORMAT = %r{^((?:[a-zA-Z]:)?[^:]+):(\d+)(?::in [`']([^']+)')?$}
STRING_EMPTY = "".freeze
GEM_ROOT = "[GEM_ROOT]".freeze
PROJECT_ROOT = "[PROJECT_ROOT]".freeze
Expand Down
10 changes: 10 additions & 0 deletions test/test_backtrace.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# frozen_string_literal: true

require "test_helper"

class TestSolidErrors < Minitest::Test
def test_backtrace
backtrace = SolidErrors::Backtrace.parse(caller(0)).to_a
assert_equal backtrace[0][:method], "TestSolidErrors#test_backtrace"
end
end

0 comments on commit aa7a1a8

Please sign in to comment.