File: Imager.pm

package info (click to toggle)
libimager-perl 1.005%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 6,308 kB
  • ctags: 4,067
  • sloc: perl: 30,915; ansic: 27,680; makefile: 55; cpp: 4
file content (45 lines) | stat: -rw-r--r-- 952 bytes parent folder | download | duplicates (4)
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
package Pod::Coverage::Imager;
use strict;
use base 'Pod::Coverage';

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;