diff options
| author | Jack Nagel | 2013-01-23 00:26:24 -0600 |
|---|---|---|
| committer | Jack Nagel | 2013-01-26 12:14:43 -0600 |
| commit | 55903312908239e7f2c4d5be39bc16e03a206e04 (patch) | |
| tree | 6a22887d857746bb769dd6140d043535a2cb9b81 /Library/Homebrew/tab.rb | |
| parent | a875e092170522cd9ba674c24da6a656d41e4298 (diff) | |
| download | homebrew-55903312908239e7f2c4d5be39bc16e03a206e04.tar.bz2 | |
Tab#with? to mirror BuildOptions#with?
Eventually a common interface could be factored out into a module, but
for now this will suffice.
Diffstat (limited to 'Library/Homebrew/tab.rb')
| -rw-r--r-- | Library/Homebrew/tab.rb | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/Library/Homebrew/tab.rb b/Library/Homebrew/tab.rb index 6735efe5d..20f7b729b 100644 --- a/Library/Homebrew/tab.rb +++ b/Library/Homebrew/tab.rb @@ -58,10 +58,24 @@ class Tab < OpenStruct :HEAD => nil end - def installed_with? opt + def with? name + if options.include? "with-#{name}" + used_options.include? "with-#{name}" + elsif options.include? "without-#{name}" + not used_options.include? "without-#{name}" + else + false + end + end + + def include? opt used_options.include? opt end + def universal? + used_options.include? "universal" + end + def used_options Options.new(super.map { |o| Option.new(o) }) end |
