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.
52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'diagnostic/finding.rb', line 52 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.
43 44 45 |
# File 'diagnostic/finding.rb', line 43 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.
46 47 48 |
# File 'diagnostic/finding.rb', line 46 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.
49 50 51 |
# File 'diagnostic/finding.rb', line 49 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.
37 38 39 |
# File 'diagnostic/finding.rb', line 37 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.
40 41 42 |
# File 'diagnostic/finding.rb', line 40 def tier @tier end |
Class Method Details
.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.
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'diagnostic/finding.rb', line 90 def self.(tier:) return if tier.to_s == "1" tier_title, tier_slug, tier_issues = if tier.to_s == "unsupported" ["Unsupported", "unsupported", "Do not report any issues"] else ["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 a #{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.
71 72 73 74 75 76 77 78 79 |
# File 'diagnostic/finding.rb', line 71 def to_h { text:, tier:, affects:, links:, remediation: @remediation&.to_h, } end |