Class: Homebrew::Vulns::Match::ReconciledHistory Private
- Defined in:
- vulns/match.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.
A history decision, not permission to replace a stored record. Callers must also validate its provenance and observe every required platform.
Instance Attribute Summary collapse
-
#intervals ⇒ Array<Interval>
readonly
private
Returns the value of prop
intervals. -
#reasons ⇒ Array<Symbol>
readonly
private
Returns the value of prop
reasons. -
#state ⇒ Symbol
readonly
private
Returns the value of prop
state.
Class Method Summary collapse
Instance Method Summary collapse
- #events ⇒ Array<Hash{Symbol => String}> private
- #fixed ⇒ String? private
- #initialize(state:, intervals: [], reasons:) ⇒ void constructor
- #introduced ⇒ String? private
Constructor Details
Instance Attribute Details
#intervals ⇒ Array<Interval> (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.
Returns the value of prop intervals.
|
|
# File '' const :intervals, T::Array[Interval], default: [] |
#reasons ⇒ Array<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.
Returns the value of prop reasons.
|
|
# File ''
|
#state ⇒ 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.
Returns the value of prop state.
|
|
# File '' const :state, Symbol |
Class Method Details
.combine(results) ⇒ ReconciledHistory
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.
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
# File 'vulns/match.rb', line 112 def self.combine(results) reasons = results.flat_map(&:reasons) reasons << :preserved if results.any? { |result| result.state == :preserved } if (results.empty? || results.any? do |result| [:range, :never_affected].exclude?(result.state) end) && reasons.empty? reasons << :unsupported_result end ranges = results.select { |result| result.state == :range } if ranges.any? { |result| result.intervals.empty? || result.intervals.any? { |interval| !interval.valid? } } reasons << :invalid_interval end return new(state: :unresolved, reasons: reasons.uniq.sort) if reasons.any? intervals = Interval.union(ranges.flat_map(&:intervals)) new(state: intervals.empty? ? :never_affected : :range, intervals:, reasons: []) end |
Instance Method Details
#events ⇒ Array<Hash{Symbol => 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.
109 |
# File 'vulns/match.rb', line 109 def events = intervals.flat_map(&:events) |
#fixed ⇒ 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.
106 |
# File 'vulns/match.rb', line 106 def fixed = intervals.last&.fixed |
#introduced ⇒ 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.
103 |
# File 'vulns/match.rb', line 103 def introduced = intervals.first&.introduced |