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 63 64 65 66 67 |
# File 'diagnostic/finding.rb', line 54 def initialize(text, tier: 1, affects: [], links: [], remediation: nil) @text = text @tier = tier @affects = affects @links = links @remediation ||= T.let( if remediation.is_a?(String) Remediation.new(text: remediation) else remediation end, T.nilable(Homebrew::Diagnostic::Finding::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.
92 93 94 95 96 |
# File 'diagnostic/finding.rb', line 92 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.
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'diagnostic/finding.rb', line 99 def self.(tier:) return if tier.to_s == "1" tier_title, tier_slug, tier_issues = if tier.to_s == "unsupported" ["an Unsupported", "unsupported", "Do not report any issues"] else ["a Tier #{tier}", "tier-#{tier.to_s.downcase}", "You can report issues with Tier #{tier} configurations"] end tier_issues = "Report issues to the upstream Nix project, not" if OS.nix_managed_homebrew? <<~EOS This is #{tier_title} configuration: #{Formatter.url("https://docs.brew.sh/Support-Tiers##{tier_slug}")} #{Formatter.bold("#{tier_issues} to Homebrew/* repositories!")} #{Formatter.url(OS::ISSUES_URL) if defined?(OS::ISSUES_URL)} Read the above document before opening any issues or PRs. 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.
73 74 75 76 77 78 79 80 81 |
# File 'diagnostic/finding.rb', line 73 def to_h { text:, tier:, affects:, links:, remediation: @remediation&.to_h, } end |