1 package Pod::Coverage::CountParents;
4 use base 'Pod::Coverage';
6 # this code considered lightly fugly :)
10 my $package = $self->{package};
12 eval qq{ require $package };
14 $self->{why_unrated} = "Couldn't compile '$package' to inspect: $@";
19 $pods{$package} = $self->SUPER::_get_pods;
21 __walk_up($package, \%pods);
22 my %flat = map { $_ => 1 } map { @{ $_ || [] } } values %pods;
23 return [ keys %flat ];
30 $pods->{$package} = Pod::Coverage->new(package => $package)->_get_pods();
35 @parents = @{"$package\::ISA"};
38 do { $pods->{$_} || __walk_up($_, $pods) } for @parents;
47 Pod::Coverage::CountParents - subclass of Pod::Coverage that examines the inheritance tree
51 # all in one invocation
52 use Pod::Coverage::CountParents package => 'Fishy';
55 use Pod::Coverage::CountParents;
56 my $pc = new Pod::Coverage::CountParents package => 'Pod::Coverage';
57 print "We rock!" if $pc->coverage == 1;
61 This module extends Pod::Coverage to include the documentation from
62 parent classes when identifying the coverage of the code.
64 If you want full documentation we suggest you check the
65 L<Pod::Coverage> documentation.
69 L<Pod::Coverage>, L<base>
73 Copyright (c) 2002 Richard Clamp. All rights reserved. This program
74 is free software; you can redistribute it and/or modify it under the
75 same terms as Perl itself.