Skip to content

Commit b667c5d

Browse files
Merge pull request #74 from kuboon/fix/support-ruby340
support ruby 3.4.0 style backtrace string
2 parents b75251b + b934669 commit b667c5d

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
- '3.1.4'
1818
- '3.2.3'
1919
- '3.3.0'
20+
- '3.4.0'
2021
steps:
2122
- uses: actions/checkout@v4
2223
- name: Set up Ruby

Gemfile.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ GEM
9797
timeout
9898
net-smtp (0.5.0)
9999
net-protocol
100-
nokogiri (1.16.7-arm64-darwin)
100+
nokogiri (1.18.2-arm64-darwin)
101101
racc (~> 1.4)
102-
nokogiri (1.16.7-x86_64-linux)
102+
nokogiri (1.18.2-x86_64-linux-gnu)
103103
racc (~> 1.4)
104104
parallel (1.26.3)
105105
parser (3.3.4.2)
@@ -158,8 +158,8 @@ GEM
158158
rubocop-ast (>= 1.31.1, < 2.0)
159159
ruby-progressbar (1.13.0)
160160
securerandom (0.3.1)
161-
sqlite3 (2.0.4-arm64-darwin)
162-
sqlite3 (2.0.4-x86_64-linux-gnu)
161+
sqlite3 (2.5.0-arm64-darwin)
162+
sqlite3 (2.5.0-x86_64-linux-gnu)
163163
standard (1.40.0)
164164
language_server-protocol (~> 3.17.0.2)
165165
lint_roller (~> 1.0)

app/models/solid_errors/backtrace_line.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module SolidErrors
22
# adapted from: https://github.com/honeybadger-io/honeybadger-ruby/blob/master/lib/honeybadger/backtrace.rb
33
class BacktraceLine
44
# Backtrace line regexp (optionally allowing leading X: for windows support).
5-
INPUT_FORMAT = %r{^((?:[a-zA-Z]:)?[^:]+):(\d+)(?::in `([^']+)')?$}
5+
INPUT_FORMAT = %r{^((?:[a-zA-Z]:)?[^:]+):(\d+)(?::in [`']([^']+)')?$}
66
STRING_EMPTY = "".freeze
77
GEM_ROOT = "[GEM_ROOT]".freeze
88
PROJECT_ROOT = "[PROJECT_ROOT]".freeze

test/test_backtrace.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# frozen_string_literal: true
2+
3+
require "test_helper"
4+
5+
class TestSolidErrors < Minitest::Test
6+
def test_backtrace
7+
backtrace = SolidErrors::Backtrace.parse(caller(0)).to_a
8+
assert_includes backtrace[0][:method], "test_backtrace"
9+
end
10+
end

0 commit comments

Comments
 (0)