From ea97da9879f0691c69c297892855b7d25fa654d6 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Mon, 23 Jul 2018 19:58:39 +0100 Subject: [PATCH] tab: correctly handle options request. Because a `Tab` is an `OpenStruct` the existing calls to `any_args_or_options?` would always return `false`. This means that `Formula#declared_runtime_dependencies` would never call `Tab#without?` to check whether a dependency has been brought in by an option. Fixes #4407 --- Library/Homebrew/tab.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Library/Homebrew/tab.rb b/Library/Homebrew/tab.rb index 5c27ad1454..aa9bea684e 100644 --- a/Library/Homebrew/tab.rb +++ b/Library/Homebrew/tab.rb @@ -211,6 +211,10 @@ class Tab < OpenStruct end end + def any_args_or_options? + !used_options.empty? || !unused_options.empty? + end + def with?(val) option_names = val.respond_to?(:option_names) ? val.option_names : [val]