aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/dependable.rb
blob: 785eb94d8f8023f0d47fca12d9b1fe8b52b9985f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
require "options"

module Dependable
  RESERVED_TAGS = [:build, :optional, :recommended, :run, :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 required?
    !build? && !optional? && !recommended?
  end

  def option_tags
    tags - RESERVED_TAGS
  end

  def options
    Options.create(option_tags)
  end
end