Skip to content

Commit 453591e

Browse files
committed
Add a first cut at a program to find undocumented methods
1 parent 5eef209 commit 453591e

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

util/missing-methods.p6

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/usr/bin/env perl6
2+
#
3+
use v6;
4+
use lib 'lib';
5+
use Perl6::TypeGraph;
6+
7+
=begin pod
8+
9+
=head1 NAME
10+
11+
missing-methods
12+
13+
=head1 SYNOPSIS
14+
15+
$ perl6 util/missing-methods.p6
16+
17+
=head1 DESCRIPTION
18+
19+
A first cut at a program to find methods in a Perl 6 implementation which
20+
have not yet been documented.
21+
22+
At present this involves a call to C<p6doc> in order to find if the methods
23+
found have documentation. This could be improved by simply calling the
24+
relevant routines within C<p6doc> instead of accessing the functionality
25+
from outside.
26+
27+
=end pod
28+
29+
my $t = Perl6::TypeGraph.new-from-file('type-graph.txt');
30+
31+
for $t.sorted -> $type {
32+
my $type_name = ::($type.name);
33+
my @methods = $type_name.^methods(:local);
34+
for @methods -> $method {
35+
my $qualified_method_name = $type.name ~ '.' ~ $method.name;
36+
my $doc_output = qqx{PAGER=cat ./bin/p6doc -f $qualified_method_name};
37+
say "$qualified_method_name" if $doc_output ~~ m:s/No documentation found/;
38+
}
39+
}
40+
41+
# vim: expandtab shiftwidth=4 ft=perl6

0 commit comments

Comments
 (0)