File Coverage

blib/lib/Perl/PrereqScanner/Scanner/POE.pm
Criterion Covered Total %
statement 18 18 100.0
branch 4 4 100.0
condition 2 2 100.0
subroutine 4 4 100.0
pod 0 1 0.0
total 28 29 96.5


line stmt bran cond sub pod time code
1 2     2   14 use strict;
  2         4  
  2         59  
2 2     2   10 use warnings;
  2         6  
  2         72  
3              
4             package Perl::PrereqScanner::Scanner::POE 1.100;
5             # ABSTRACT: scan for POE components
6              
7 2     2   10 use Moo;
  2         4  
  2         12  
8             with 'Perl::PrereqScanner::Scanner';
9              
10             #pod =head1 DESCRIPTION
11             #pod
12             #pod This scanner will look for POE modules included with C
13             #pod
14             #pod use POE wq(Component::IRC);
15             #pod
16             #pod =cut
17              
18             sub scan_for_prereqs {
19 265     265 0 637 my ($self, $ppi_doc, $req) = @_;
20              
21             # regular use and require
22 265   100     647 my $includes = $ppi_doc->find('Statement::Include') || [];
23 265         165212 for my $node ( @$includes ) {
24 173 100       1472 if ( $node->module eq 'POE' ) {
25             my @meat = grep {
26 6 100       174 $_->isa('PPI::Token::QuoteLike::Words')
  6         246  
27             || $_->isa('PPI::Token::Quote')
28             } $node->arguments;
29              
30 6         16 my @components = map { $self->_q_contents($_) } @meat;
  6         21  
31 6         28 $req->add_minimum("POE::$_" => 0) for @components;
32             }
33             }
34             }
35              
36             1;
37              
38             __END__