Class: KegOnlyReason Private
- Defined in:
- extend/os/mac/keg_only_reason.rb,
keg_only_reason.rb
Overview
This class is part of a private API. This class may only be used in the Homebrew/brew repository. Third parties should avoid using this class if possible, as it may be removed or changed without warning.
Used to annotate formulae that duplicate macOS-provided software or cause conflicts when linked in.
Instance Attribute Summary collapse
- #reason ⇒ Symbol, String readonly private
Instance Method Summary collapse
- #applicable? ⇒ Boolean private
- #by_macos? ⇒ Boolean private
- #initialize(reason, explanation) ⇒ void constructor private
- #provided_by_macos? ⇒ Boolean private
- #shadowed_by_macos? ⇒ Boolean private
- #to_hash ⇒ Hash{String => String} private
- #versioned_formula? ⇒ Boolean private
Constructor Details
#initialize(reason, explanation) ⇒ void
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
11 12 13 14 |
# File 'keg_only_reason.rb', line 11 def initialize(reason, explanation) @reason = reason @explanation = explanation end |
Instance Attribute Details
#reason ⇒ Symbol, String (readonly)
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
8 9 10 |
# File 'keg_only_reason.rb', line 8 def reason @reason end |
Instance Method Details
#applicable? ⇒ Boolean
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
6 7 8 |
# File 'extend/os/mac/keg_only_reason.rb', line 6 def applicable? true end |
#by_macos? ⇒ Boolean
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
32 33 34 |
# File 'keg_only_reason.rb', line 32 def by_macos? provided_by_macos? || shadowed_by_macos? end |
#provided_by_macos? ⇒ Boolean
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
22 23 24 |
# File 'keg_only_reason.rb', line 22 def provided_by_macos? @reason == :provided_by_macos end |
#shadowed_by_macos? ⇒ Boolean
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
27 28 29 |
# File 'keg_only_reason.rb', line 27 def shadowed_by_macos? @reason == :shadowed_by_macos end |
#to_hash ⇒ Hash{String => String}
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'keg_only_reason.rb', line 67 def to_hash reason_string = if @reason.is_a?(Symbol) @reason.inspect else @reason.to_s end { "reason" => reason_string, "explanation" => @explanation, } end |
#versioned_formula? ⇒ Boolean
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
17 18 19 |
# File 'keg_only_reason.rb', line 17 def versioned_formula? @reason == :versioned_formula end |