Fix left-join chaining
[dbsrgits/DBIx-Class.git] / maint / inheritance_pod.pl
CommitLineData
cdb372c3 1#!/usr/bin/perl
2use strict;
3use warnings;
4use lib qw(lib t/lib);
5
6# USAGE:
7# maint/inheritance_pod.pl Some::Module
8
9my $module = $ARGV[0];
10eval(" require $module; ");
11
12my @modules = Class::C3::calculateMRO($module);
13shift( @modules );
14
15print "=head1 INHERITED METHODS\n\n";
16
17foreach my $module (@modules) {
18 print "=head2 $module\n\n";
19 print "=over 4\n\n";
20 my $file = $module;
21 $file =~ s/::/\//g;
22 $file .= '.pm';
23 foreach my $path (@INC){
24 if (-e "$path/$file") {
25 open(MODULE,"<$path/$file");
26 while (my $line = <MODULE>) {
27 if ($line=~/^\s*sub ([a-z][a-z_]+) \{/) {
28 my $method = $1;
29 print "=item *\n\n";
30 print "L<$method|$module/$method>\n\n";
31 }
32 }
33 close(MODULE);
34 last;
35 }
36 }
37 print "=back\n\n";
38}
39
401;