Tab#with? to mirror BuildOptions#with?

Eventually a common interface could be factored out into a module, but
for now this will suffice.
This commit is contained in:
Jack Nagel 2013-01-23 00:26:24 -06:00
parent e2c4a05235
commit 02b8d34339

View File

@ -58,10 +58,24 @@ class Tab < OpenStruct
:HEAD => nil :HEAD => nil
end 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 used_options.include? opt
end end
def universal?
used_options.include? "universal"
end
def used_options def used_options
Options.new(super.map { |o| Option.new(o) }) Options.new(super.map { |o| Option.new(o) })
end end