aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/software_spec.rb
diff options
context:
space:
mode:
authorJack Nagel2014-07-31 19:37:39 -0500
committerJack Nagel2014-07-31 19:59:09 -0500
commit4226386ef99e71c149b0bb45cba4dca5c52e6054 (patch)
tree056a0f0c368624863600201081c7cd63e3d10c4d /Library/Homebrew/software_spec.rb
parent1b182b422bedeb0cd12f6634a692399242e140fd (diff)
downloadhomebrew-4226386ef99e71c149b0bb45cba4dca5c52e6054.tar.bz2
Hide the options data structure better
Diffstat (limited to 'Library/Homebrew/software_spec.rb')
-rw-r--r--Library/Homebrew/software_spec.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/Library/Homebrew/software_spec.rb b/Library/Homebrew/software_spec.rb
index fcede796c..88370e0fa 100644
--- a/Library/Homebrew/software_spec.rb
+++ b/Library/Homebrew/software_spec.rb
@@ -71,6 +71,10 @@ class SoftwareSpec
end
end
+ def option_defined?(name)
+ options.include?(name)
+ end
+
def option name, description=nil
name = 'c++11' if name == :cxx11
name = name.to_s if Symbol === name
@@ -105,9 +109,9 @@ class SoftwareSpec
def add_dep_option(dep)
name = dep.option_name
- if dep.optional? && !options.include?("with-#{name}")
+ if dep.optional? && !option_defined?("with-#{name}")
options << Option.new("with-#{name}", "Build with #{name} support")
- elsif dep.recommended? && !options.include?("without-#{name}")
+ elsif dep.recommended? && !option_defined?("without-#{name}")
options << Option.new("without-#{name}", "Build without #{name} support")
end
end