Class: Homebrew::Diagnostic::Finding Private
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.
Defined Under Namespace
Classes: Remediation
Instance Attribute Summary collapse
- #affects ⇒ Array<String> readonly private
- #links ⇒ Array<String> readonly private
- #remediation ⇒ Remediation? readonly private
- #text ⇒ String readonly private
- #tier ⇒ Integer, Symbol readonly private
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(text, tier: 1, affects: [], links: [], remediation: nil) ⇒ void constructor private
- #to_h ⇒ Hash{Symbol => Integer, Symbol, String, Array<String>, Hash{Symbol => String, Array<String>}, nil} private
Constructor Details
#initialize(text, tier: 1, affects: [], links: [], remediation: nil) ⇒ 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.
54 55 56 57 58 59 60 61 62 |
# File 'diagnostic/finding.rb', line 54 def initialize(text, tier: 1, affects: [], links: [], remediation: nil) @text = text @tier = tier @affects = affects @links = links remediation = Remediation.new(text: remediation) if remediation.is_a?(String) @remediation = T.let(remediation, T.nilable(Remediation)) end |
Instance Attribute Details
#affects ⇒ Array<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.
45 46 47 |
# File 'diagnostic/finding.rb', line 45 def affects @affects end |
#links ⇒ Array<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.
48 49 50 |
# File 'diagnostic/finding.rb', line 48 def links @links end |
#remediation ⇒ Remediation? (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.
51 52 53 |
# File 'diagnostic/finding.rb', line 51 def remediation @remediation end |
#text ⇒ 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.
39 40 41 |
# File 'diagnostic/finding.rb', line 39 def text @text end |
#tier ⇒ Integer, Symbol (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.
42 43 44 |
# File 'diagnostic/finding.rb', line 42 def tier @tier end |
Class Method Details
.support_tier(tiers) ⇒ Integer, Symbol
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.
87 88 89 90 91 |
# File 'diagnostic/finding.rb', line 87 def self.support_tier(tiers) return :unsupported if tiers.include?(:unsupported) tiers.grep(Integer).max || 1 end |
.support_tier_message(tier:) ⇒ 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.
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'diagnostic/finding.rb', line 94 def self.(tier:) return if tier.to_s == "1" tier = :unsupported if tier == "unsupported" tier = tier.to_i if tier.is_a?(String) tier_title, tier_slug = if tier == :unsupported ["an Unsupported", "unsupported"] else ["a Tier #{tier}", "tier-#{tier}"] end <<~EOS This is #{tier_title} configuration: #{Formatter.url("https://docs.brew.sh/Support-Tiers##{tier_slug}")} #{Utils::Output.(:homebrew, tier:)} EOS end |
Instance Method Details
#to_h ⇒ Hash{Symbol => Integer, Symbol, String, Array<String>, Hash{Symbol => String, Array<String>}, nil}
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.
68 69 70 71 72 73 74 75 76 |
# File 'diagnostic/finding.rb', line 68 def to_h { text:, tier:, affects:, links:, remediation: @remediation&.to_h, } end |