eliminate use vars
[imager.git] / t / Pod / Coverage / Imager.pm
CommitLineData
47911724 1package Pod::Coverage::Imager;
ee64a81f 2use 5.006;
52db4f96 3use strict;
47911724
TC
4use base 'Pod::Coverage';
5
ee64a81f
TC
6our $VERSION = "1.000";
7
47911724
TC
8sub _get_pods {
9 my $self = shift;
10
11 my $package = $self->{package};
12
13 #print "getting pod location for '$package'\n" if TRACE_ALL;
14 $self->{pod_from} ||= pod_where( { -inc => 1 }, $package );
15
16 my $pod_from = $self->{pod_from};
17 $pod_from = [ $pod_from ] unless ref $pod_from;
18 unless ($pod_from) {
19 $self->{why_unrated} = "couldn't find pod";
20 return;
21 }
22
23 #print "parsing '$pod_from'\n" if TRACE_ALL;
24 my $pod = Pod::Coverage::Extractor->new;
25 for my $pod_file (@$pod_from) {
26 $pod->parse_from_file( $pod_file, '/dev/null' );
27 }
28
29 return $pod->{identifiers} || [];
30}
31
6d5c85a2
TC
32sub _get_syms {
33 my ($self, $package) = @_;
34
35 if ($self->{module}) {
36 eval "require $self->{module}";
37 return if $@;
38
39 # fake out require
40 (my $file = $package) =~ s(::)(/)g;
41 $file .= ".pm";
42 $INC{$file} = 1;
43 }
44
45 return $self->SUPER::_get_syms($package);
46}
47
47911724 481;