File Coverage

blib/lib/Pod/Eventual/Simple.pm
Criterion Covered Total %
statement 20 20 100.0
branch 1 2 50.0
condition n/a
subroutine 8 8 100.0
pod 2 3 66.6
total 31 33 93.9


line stmt bran cond sub pod time code
1 4     4   235219 use strict;
  4         39  
  4         104  
2 4     4   16 use warnings;
  4         7  
  4         200  
3             package Pod::Eventual::Simple 0.094003;
4 4     4   1344 use Pod::Eventual;
  4         12  
  4         148  
5 4     4   491 BEGIN { our @ISA = 'Pod::Eventual' }
6             # ABSTRACT: just get an array of the stuff Pod::Eventual finds
7              
8             #pod =head1 SYNOPSIS
9             #pod
10             #pod use Pod::Eventual::Simple;
11             #pod
12             #pod my $output = Pod::Eventual::Simple->read_file('awesome.pod');
13             #pod
14             #pod This subclass just returns an array reference when you use the reading methods.
15             #pod The arrayref contains all the Pod events and non-Pod content. Non-Pod content
16             #pod is given as hashrefs like this:
17             #pod
18             #pod {
19             #pod type => 'nonpod',
20             #pod content => "This is just some text\n",
21             #pod start_line => 162,
22             #pod }
23             #pod
24             #pod For just the POD events, grep for C not equals "nonpod"
25             #pod
26             #pod =for Pod::Coverage new
27             #pod
28             #pod =cut
29              
30             sub new {
31 4     4 0 11 my ($class) = @_;
32 4         10 bless [] => $class;
33             }
34              
35             sub read_handle {
36 4     4 1 932 my ($self, $handle, $arg) = @_;
37 4 50       32 $self = $self->new unless ref $self;
38 4         33 $self->SUPER::read_handle($handle, $arg);
39 4         71 return [ @$self ];
40             }
41              
42             sub handle_event {
43 57     57 1 136 my ($self, $event) = @_;
44 57         119 push @$self, $event;
45             }
46              
47             BEGIN {
48 4     4   17 *handle_blank = \&handle_event;
49 4         101 *handle_nonpod = \&handle_event;
50             }
51              
52             1;
53              
54             __END__