brew/Library/Homebrew/dependable.rb
Mike McQuaid fea9bc1e42 Allow :test dependencies.
These specify that they are needed by the test block. This can be
combined with `:build` to ensure that this formula isn't uninstalled
by `brew test-bot` when running `test do` blocks on our CI.
2018-03-05 10:36:39 +00:00

38 lines
538 B
Ruby

require "options"
module Dependable
RESERVED_TAGS = [:build, :optional, :recommended, :run, :test, :linked].freeze
def build?
tags.include? :build
end
def optional?
tags.include? :optional
end
def recommended?
tags.include? :recommended
end
def run?
tags.include? :run
end
def test?
tags.include? :test
end
def required?
!build? && !test? && !optional? && !recommended?
end
def option_tags
tags - RESERVED_TAGS
end
def options
Options.create(option_tags)
end
end