class

Bindgen::FindPath::VersionChecker

Inherits Bindgen::FindPath::Checker < Reference < Object

Checker for a VersionCheck. This is a special checker. It can't be instantiated in the PathConfig#checks array, but only through PathConfig#version.

Constants

HIGHEST_POSSIBLE = "~"
LOWEST_POSSIBLE = " "

Constructors

new(config : VersionCheck)
Source

Instance methods

best_candidate

Returns the best checked candidate

Source
candidates

Stores all candidates

Source
check(path : String) : Bool

Checks path by its #version_of. Only succeeds if a version was found and is in the configured range, or if the fallback accepts it.

Source
sorted_candidates

Returns the list of sorted candidates, from the best candidate first down to worse candidates.

Source
version_of(path : String) : String | Nil

Returns the version of path: the capture of the configured regex on path, or on the output of the configured shell command with path expanded into it. STDOUT is hidden, but STDERR is shown. Returns nil if the command failed, or nothing matched.

Source

Nested types