diff options
| author | Jack Nagel | 2014-07-31 19:37:39 -0500 | 
|---|---|---|
| committer | Jack Nagel | 2014-07-31 19:59:09 -0500 | 
| commit | 4226386ef99e71c149b0bb45cba4dca5c52e6054 (patch) | |
| tree | 056a0f0c368624863600201081c7cd63e3d10c4d /Library/Homebrew/software_spec.rb | |
| parent | 1b182b422bedeb0cd12f6634a692399242e140fd (diff) | |
| download | homebrew-4226386ef99e71c149b0bb45cba4dca5c52e6054.tar.bz2 | |
Hide the options data structure better
Diffstat (limited to 'Library/Homebrew/software_spec.rb')
| -rw-r--r-- | Library/Homebrew/software_spec.rb | 8 | 
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 | 
