Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
-l now lists panda installed modules as pod candidates
  • Loading branch information
stmuk committed Jan 19, 2016
1 parent 28e6394 commit ac1285c
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion bin/p6doc
Expand Up @@ -113,11 +113,14 @@ multi sub MAIN($docee, Bool :$n) {

multi sub MAIN(Bool :$l!) {
my @paths = search-paths() X~ <Type/ Language/> ;
my @modules;
for @paths -> $dir {
for dir($dir).sort -> $file {
say $file.basename.Str.subst('.pod','') if $file.f;
@modules.push: $file.basename.Str.subst('.pod','');
}
}
@modules.append: get-panda-modules();
.say for @modules.sort;
}

multi sub MAIN($docee, Bool :$f!, Bool :$n) {
Expand Down Expand Up @@ -245,5 +248,16 @@ sub locate-curli-module($module) {
}
return;
}
sub get-panda-modules {
my $state = Panda::Installer.new.default-prefix() ~ '/panda/state';
my @modules;
for $state.IO.lines -> $line {
my (Any, $json ) = $line.split(/'installed '|'installed-dep '/);
my $state = from-json $json;
@modules.append: $state<provides>.keys.list;
}

return @modules;
}

# vim: expandtab shiftwidth=4 ft=perl6

0 comments on commit ac1285c

Please sign in to comment.