Module: Dependable

Included in:
Dependency, Requirement
Defined in:
Library/Homebrew/dependable.rb

Constant Summary collapse

RESERVED_TAGS =
[:build, :optional, :recommended, :run, :linked].freeze

Instance Method Summary collapse

Instance Method Details

#build?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'Library/Homebrew/dependable.rb', line 6

def build?
  tags.include? :build
end

#option_tagsObject



26
27
28
# File 'Library/Homebrew/dependable.rb', line 26

def option_tags
  tags - RESERVED_TAGS
end

#optional?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'Library/Homebrew/dependable.rb', line 10

def optional?
  tags.include? :optional
end

#optionsObject



30
31
32
# File 'Library/Homebrew/dependable.rb', line 30

def options
  Options.create(option_tags)
end

#recommended?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'Library/Homebrew/dependable.rb', line 14

def recommended?
  tags.include? :recommended
end

#required?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'Library/Homebrew/dependable.rb', line 22

def required?
  !build? && !optional? && !recommended?
end

#run?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'Library/Homebrew/dependable.rb', line 18

def run?
  tags.include? :run
end