aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/build_options.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/build_options.rb')
-rw-r--r--Library/Homebrew/build_options.rb20
1 files changed, 11 insertions, 9 deletions
diff --git a/Library/Homebrew/build_options.rb b/Library/Homebrew/build_options.rb
index 2e8f741d4..9ceeab394 100644
--- a/Library/Homebrew/build_options.rb
+++ b/Library/Homebrew/build_options.rb
@@ -24,21 +24,23 @@ class BuildOptions
# args << "--with-example1"
# end</pre>
def with?(val)
- name = val.respond_to?(:option_name) ? val.option_name : val
+ option_names = val.respond_to?(:option_names) ? val.option_names : [val]
- if option_defined? "with-#{name}"
- include? "with-#{name}"
- elsif option_defined? "without-#{name}"
- !include? "without-#{name}"
- else
- false
+ option_names.any? do |name|
+ if option_defined? "with-#{name}"
+ include? "with-#{name}"
+ elsif option_defined? "without-#{name}"
+ !include? "without-#{name}"
+ else
+ false
+ end
end
end
# True if a {Formula} is being built without a specific option.
# <pre>args << "--no-spam-plz" if build.without? "spam"
- def without?(name)
- !with? name
+ def without?(val)
+ !with?(val)
end
# True if a {Formula} is being built as a bottle (i.e. binary package).