File tree Expand file tree Collapse file tree 3 files changed +19
-8
lines changed
Expand file tree Collapse file tree 3 files changed +19
-8
lines changed Original file line number Diff line number Diff line change 1515 - 3.1
1616 - 3.2
1717 - 3.3
18+ - 3.4
1819 env :
1920 BUNDLE_GEMFILE : Gemfile
2021 name : " RSpec tests: Ruby ${{ matrix.ruby }}"
Original file line number Diff line number Diff line change 11Gem ::Specification . new do |spec |
22 spec . name = 'code_ownership'
3- spec . version = '1.38.1 '
3+ spec . version = '1.38.2 '
44 spec . authors = [ 'Gusto Engineers' ]
55 spec . email = [ '[email protected] ' ] 66 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)
136136 #
137137 # ./app/controllers/some_controller.rb:43:in `block (3 levels) in create'
138138 #
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
146156
147157 backtrace . lazy . filter_map do |line |
148158 match = line . match ( backtrace_line )
You can’t perform that action at this time.
0 commit comments