File: Imager.pm

package info (click to toggle)
libimager-perl 1.027%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,820 kB
  • sloc: perl: 32,971; ansic: 28,092; makefile: 52; cpp: 4
file content (48 lines) | stat: -rw-r--r-- 988 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package Pod::Coverage::Imager;
use 5.006;
use strict;
use base 'Pod::Coverage';

our $VERSION = "1.000";

sub _get_pods {
  my $self = shift;

  my $package = $self->{package};

  #print "getting pod location for '$package'\n" if TRACE_ALL;
  $self->{pod_from} ||= pod_where( { -inc => 1 }, $package );

  my $pod_from = $self->{pod_from};
  $pod_from = [ $pod_from ] unless ref $pod_from;
  unless ($pod_from) {
    $self->{why_unrated} = "couldn't find pod";
    return;
  }
  
  #print "parsing '$pod_from'\n" if TRACE_ALL;
  my $pod = Pod::Coverage::Extractor->new;
  for my $pod_file (@$pod_from) {
    $pod->parse_from_file( $pod_file, '/dev/null' );
  }
  
  return $pod->{identifiers} || [];
}

sub _get_syms {
  my ($self, $package) = @_;

  if ($self->{module}) {
    eval "require $self->{module}";
    return if $@;

    # fake out require
    (my $file = $package) =~ s(::)(/)g;
    $file .= ".pm";
    $INC{$file} = 1;
  }

  return $self->SUPER::_get_syms($package);
}

1;