From 337cda7d9222f1f449905454a7374222017a7477 Mon Sep 17 00:00:00 2001 From: Nate Hopkins Date: Thu, 14 Mar 2024 09:58:19 -0600 Subject: [PATCH] Merge pull request from GHSA-mp76-7w5v-pr75 --- lib/turbo_boost/commands/runner.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/turbo_boost/commands/runner.rb b/lib/turbo_boost/commands/runner.rb index 2cfee83c..f861df9e 100644 --- a/lib/turbo_boost/commands/runner.rb +++ b/lib/turbo_boost/commands/runner.rb @@ -38,7 +38,8 @@ def command_valid? end # validate method - unless command_instance.respond_to?(command_method_name) + ancestors = command_class.ancestors[0..command_class.ancestors.index(TurboBoost::Commands::Command) - 1] + unless ancestors.any? { |a| a.public_instance_methods(false).any? command_method_name.to_sym } raise TurboBoost::Commands::InvalidMethodError, "`#{command_class_name}` does not define the public method `#{command_method_name}`!" end