Telemetry run context library fix - caller location handling for Ruby 3.4

Signed-off-by: Nik08 <nikita.mathur@progress.com>
This commit is contained in:
Nik08 2024-09-10 15:41:05 +05:30
parent 2bbe8d97c0
commit f01e4795f2

View file

@ -26,8 +26,11 @@ module Inspec
end
def self.run_by_thor?(stack)
stack_match(stack: stack, path: "thor/command", label: "run") &&
stack_match(stack: stack, path: "thor/invocation", label: "invoke_command")
# Handled in both ways to fix label differences for Ruby 3.4 and other versions of Ruby
(stack_match(stack: stack, path: "thor/command", label: "Thor::Command#run") &&
stack_match(stack: stack, path: "thor/invocation", label: "Thor::Invocation#invoke_command")) ||
(stack_match(stack: stack, path: "thor/command", label: "run") &&
stack_match(stack: stack, path: "thor/invocation", label: "invoke_command"))
end
def self.kitchen?(stack)