candidates
ErrorsCollection

candidates

Synthesised documentation from type/CompUnit/Repository/FileSystem type/Routine type/CompUnit/Repository/Installation

From type/CompUnit/Repository/FileSystem

See Original text in context

multi method candidates(Str:D $name:$auth:$ver:$api)
multi method candidates(CompUnit::DependencySpecification $spec)

Return all distributions that contain a module matching the specified $name, auth, ver, and api.

# assuming one is cloned into the zef git repository... 
my $repo = CompUnit::Repository::FileSystem.new(prefix => $*CWD);
with $repo.candidates("Zef").head -> $dist {
    say "Zef version: " ~ $dist.meta<version>;
}
else {
    say "No candidates for 'Zef' found";
}

From type/Routine

See Original text in context

method candidates(Routine:D: --> Positional:D)

Returns a list of multi candidates, or a one-element list with itself if it's not a multi

From type/CompUnit/Repository/Installation

See Original text in context

multi method candidates(Str:D $name:$auth:$ver:$api)
multi method candidates(CompUnit::DependencySpecification $spec)

Return all distributions that contain a module matching the specified $name, auth, ver, and api.

my $inst-repo-path = CompUnit::RepositoryRegistry.repository-for-name("perl").prefix;
my $inst-repo = CompUnit::Repository::Installation.new(prefix => $inst-repo-path);
my $dist = $inst-repo.candidates("Test").head;
say "Test version: " ~ $dist.meta<ver># OUTPUT: «6.d␤»