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   38 use strict;
  2         6  
  2         57  
2 2     2   9 use warnings;
  2         4  
  2         72  
3              
4             package Perl::PrereqScanner::Scanner::POE 1.025;
5             # ABSTRACT: scan for POE components
6              
7 2     2   10 use Moose;
  2         4  
  2         10  
8             with 'Perl::PrereqScanner::Scanner';
9              
10             #pod =head1 DESCRIPTION
11             #pod
12             #pod This scanner will look for POE modules included with C<use POE>
13             #pod
14             #pod use POE wq(Component::IRC);
15             #pod
16             #pod =cut
17              
18             sub scan_for_prereqs {
19 265     265 0 579 my ($self, $ppi_doc, $req) = @_;
20              
21             # regular use and require
22 265   100     569 my $includes = $ppi_doc->find('Statement::Include') || [];
23 265         129574 for my $node ( @$includes ) {
24 171 100       1172 if ( $node->module eq 'POE' ) {
25             my @meat = grep {
26 6 100       135 $_->isa('PPI::Token::QuoteLike::Words')
  6         167  
27             || $_->isa('PPI::Token::Quote')
28             } $node->arguments;
29              
30 6         12 my @components = map { $self->_q_contents($_) } @meat;
  6         20  
31 6         25 $req->add_minimum("POE::$_" => 0) for @components;
32             }
33             }
34             }
35              
36             1;
37              
38             __END__
39              
40             =pod
41              
42             =encoding UTF-8
43              
44             =head1 NAME
45              
46             Perl::PrereqScanner::Scanner::POE - scan for POE components
47              
48             =head1 VERSION
49              
50             version 1.025
51              
52             =head1 DESCRIPTION
53              
54             This scanner will look for POE modules included with C<use POE>
55              
56             use POE wq(Component::IRC);
57              
58             =head1 PERL VERSION
59              
60             This library should run on perls released even a long time ago. It should work
61             on any version of perl released in the last five years.
62              
63             Although it may work on older versions of perl, no guarantee is made that the
64             minimum required version will not be increased. The version may be increased
65             for any reason, and there is no promise that patches will be accepted to lower
66             the minimum required perl.
67              
68             =head1 AUTHORS
69              
70             =over 4
71              
72             =item *
73              
74             Jerome Quelin
75              
76             =item *
77              
78             Ricardo Signes <cpan@semiotic.systems>
79              
80             =back
81              
82             =head1 COPYRIGHT AND LICENSE
83              
84             This software is copyright (c) 2009 by Jerome Quelin.
85              
86             This is free software; you can redistribute it and/or modify it under
87             the same terms as the Perl 5 programming language system itself.
88              
89             =cut