class Bindgen::FindPath::VersionChecker

Overview

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

Defined in:

bindgen/find_path/version_checker.cr

Constant Summary

HIGHEST_POSSIBLE = "~"
LOWEST_POSSIBLE = " "

Constructors

Instance Method Summary

Instance methods inherited from class Bindgen::FindPath::Checker

check(path : String) : Bool check

Constructor methods inherited from class Bindgen::FindPath::Checker

create(config, is_file) : Checker create

Constructor Detail

def self.new(config : VersionCheck) #

[View source]

Instance Method Detail

def best_candidate : String | Nil #

Returns the best checked candidate


[View source]
def candidates : Array({String, String}) #

Stores all candidates


[View source]
def 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.


[View source]
def sorted_candidates : Array(Tuple(String, String)) #

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


[View source]
def 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.


[View source]