From 88af4fc0ac39cc1799d16c49fab52f6dfbcec9ba 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 3589c068..be350649 100644 --- a/lib/turbo_boost/commands/runner.rb +++ b/lib/turbo_boost/commands/runner.rb @@ -40,7 +40,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