Skip to content

Commit 4da6fc2

Browse files
committed
Reflect Ruby 3.4 stack trace changes
Ruby 3.4 changed the stack frame formatting and that meant it no longer recognized the Puppet stack frames. This updates the regex for the new format.
1 parent 2442dda commit 4da6fc2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/puppet/util.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,11 @@ def thinmark
523523

524524
module_function :thinmark
525525

526-
PUPPET_STACK_INSERTION_FRAME = /.*puppet_stack\.rb.*in.*`stack'/
526+
PUPPET_STACK_INSERTION_FRAME = if RUBY_VERSION >= '3.4'
527+
/.*puppet_stack\.rb.*in.*'Puppet::Pops::PuppetStack\.stack'/
528+
else
529+
/.*puppet_stack\.rb.*in.*`stack'/
530+
end
527531

528532
# utility method to get the current call stack and format it to a human-readable string (which some IDEs/editors
529533
# will recognize as links to the line numbers in the trace)

0 commit comments

Comments
 (0)