File Coverage

blib/lib/Embperl/Recipe/Embperl.pm
Criterion Covered Total %
statement 16 17 94.1
branch 6 12 50.0
condition n/a
subroutine 3 3 100.0
pod 1 1 100.0
total 26 33 78.7


line stmt bran cond sub pod time code
1              
2             ###################################################################################
3             #
4             # Embperl - Copyright (c) 1997-2008 Gerald Richter / ecos gmbh www.ecos.de
5             # Embperl - Copyright (c) 2008-2014 Gerald Richter
6             #
7             # You may distribute under the terms of either the GNU General Public
8             # License or the Artistic License, as specified in the Perl README file.
9             #
10             # THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
11             # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
12             # WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13             #
14             # $Id: Embperl.pm 1578075 2014-03-16 14:01:14Z richter $
15             #
16             ###################################################################################
17              
18              
19             package Embperl::Recipe::Embperl ;
20              
21 1     1   13 use strict ;
  1         5  
  1         72  
22 1     1   8 use vars qw{@ISA} ;
  1         2  
  1         497  
23              
24             @ISA = ('Embperl::Recipe') ;
25              
26             # ---------------------------------------------------------------------------------
27             #
28             # Create a new recipe by converting request parameter
29             #
30             # ---------------------------------------------------------------------------------
31              
32              
33             sub get_recipe
34              
35             {
36 100     100 1 272 my ($class, $r, $recipe, $src, $syntax) = @_ ;
37              
38 100         141 my $self ;
39 100         603 my $param = $r -> component -> param ;
40 100         4558 my @recipe ;
41              
42 100 50       312 if (!$src)
43             {
44 100 50       2107 push @recipe, {'type' => ref ($param -> input)?'memory':($param -> subreq?'apoutfilter':'file') } ;
    100          
45             }
46             else
47             {
48 0 0       0 push @recipe, ref $src eq 'ARRAY'?@$src:$src ;
49             }
50              
51 100 50       499 push @recipe, {'type' => 'epparse', $syntax?(syntax => $syntax):() } ;
52 100         513 push @recipe, {'type' => 'epcompile', cache => 1 } ;
53 100 50       732 push @recipe, {'type' => 'eprun' } if ($param -> import < 0) ;
54              
55 100         575 return \@recipe ;
56             }
57              
58             1;
59              
60             __END__