Class: BottleDisableReason
- Inherits:
-
Object
- Object
- BottleDisableReason
- Defined in:
- Library/Homebrew/formula_support.rb
Overview
Used to annotate formulae that don't require compiling or cannot build a bottle.
Constant Summary collapse
- SUPPORTED_TYPES =
[:unneeded, :disable].freeze
Instance Method Summary collapse
-
#initialize(type, reason) ⇒ BottleDisableReason
constructor
A new instance of BottleDisableReason.
-
#to_s ⇒ Object
-
#unneeded? ⇒ Boolean
-
#valid? ⇒ Boolean
Constructor Details
#initialize(type, reason) ⇒ BottleDisableReason
Returns a new instance of BottleDisableReason.
66 67 68 69 |
# File 'Library/Homebrew/formula_support.rb', line 66 def initialize(type, reason) @type = type @reason = reason end |
Instance Method Details
#to_s ⇒ Object
79 80 81 82 83 |
# File 'Library/Homebrew/formula_support.rb', line 79 def to_s return "This formula doesn't require compiling." if unneeded? @reason end |
#unneeded? ⇒ Boolean
71 72 73 |
# File 'Library/Homebrew/formula_support.rb', line 71 def unneeded? @type == :unneeded end |
#valid? ⇒ Boolean
75 76 77 |
# File 'Library/Homebrew/formula_support.rb', line 75 def valid? SUPPORTED_TYPES.include? @type end |