File tree 3 files changed +19
-8
lines changed
3 files changed +19
-8
lines changed Original file line number Diff line number Diff line change 15
15
- 3.1
16
16
- 3.2
17
17
- 3.3
18
+ - 3.4
18
19
env :
19
20
BUNDLE_GEMFILE : Gemfile
20
21
name : " RSpec tests: Ruby ${{ matrix.ruby }}"
Original file line number Diff line number Diff line change 1
1
Gem ::Specification . new do |spec |
2
2
spec . name = 'code_ownership'
3
- spec . version = '1.38.1 '
3
+ spec . version = '1.38.2 '
4
4
spec . authors = [ 'Gusto Engineers' ]
5
5
spec . email = [ '[email protected] ' ]
6
6
spec . summary = 'A gem to help engineering teams declare ownership of code'
Original file line number Diff line number Diff line change @@ -136,13 +136,23 @@ def backtrace_with_ownership(backtrace)
136
136
#
137
137
# ./app/controllers/some_controller.rb:43:in `block (3 levels) in create'
138
138
#
139
- backtrace_line = %r{\A (#{ Pathname . pwd } /|\. /)?
140
- (?<file>.+) # Matches 'app/controllers/some_controller.rb'
141
- :
142
- (?<line>\d +) # Matches '43'
143
- :in\s
144
- `(?<function>.*)' # Matches "`block (3 levels) in create'"
145
- \z }x
139
+ backtrace_line = if RUBY_VERSION >= '3.4.0'
140
+ %r{\A (#{ Pathname . pwd } /|\. /)?
141
+ (?<file>.+) # Matches 'app/controllers/some_controller.rb'
142
+ :
143
+ (?<line>\d +) # Matches '43'
144
+ :in\s
145
+ '(?<function>.*)' # Matches "`block (3 levels) in create'"
146
+ \z }x
147
+ else
148
+ %r{\A (#{ Pathname . pwd } /|\. /)?
149
+ (?<file>.+) # Matches 'app/controllers/some_controller.rb'
150
+ :
151
+ (?<line>\d +) # Matches '43'
152
+ :in\s
153
+ `(?<function>.*)' # Matches "`block (3 levels) in create'"
154
+ \z }x
155
+ end
146
156
147
157
backtrace . lazy . filter_map do |line |
148
158
match = line . match ( backtrace_line )
You can’t perform that action at this time.
0 commit comments