File Coverage

blib/lib/App/Difio/dotCloud/Parser.pm
Criterion Covered Total %
statement 6 16 37.5
branch 0 6 0.0
condition n/a
subroutine 2 5 40.0
pod n/a
total 8 27 29.6


line stmt bran cond sub pod time code
1             #####################################################################################
2             #
3             # Copyright (c) 2012, Alexander Todorov . See POD section.
4             #
5             #####################################################################################
6              
7             package App::Difio::dotCloud::Parser;
8              
9 1     1   1980 use Pod::Simple;
  1         48011  
  1         46  
10             @ISA = qw(Pod::Simple);
11 1     1   12 use strict;
  1         3  
  1         224  
12              
13             my $parser_state = "";
14              
15             sub _handle_element_start {
16 0     0     my($self, $element_name, $attr_hash_r) = @_;
17 0           $parser_state = $element_name;
18             }
19              
20             sub _handle_element_end {
21 0     0     my($self, $element_name, $attr_hash_r) = @_;
22              
23             # NOTE: $attr_hash_r is only present when $element_name is "over" or "begin"
24             # The remaining code excerpts will mostly ignore this $attr_hash_r, as it is
25             # mostly useless. It is documented where "over-*" and "begin" events are
26             # documented.
27              
28 0           $parser_state = "";
29             }
30              
31             sub _handle_text {
32 0     0     my($self, $text) = @_;
33 0           my $FH = $_[0]{'output_fh'};
34              
35 0 0         if ($parser_state eq "L") {
    0          
36 0           print $FH $text;
37             } elsif ($parser_state eq "C") {
38 0 0         if ($text =~ m/^VERSION: (.*)/) {
39 0           print $FH " $1\n";
40             }
41             }
42             }
43             1;