Debian Codegraph @

Embperl/Recipe/Embperl.pm

raw
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 use strict ;
22 use vars qw{@ISA} ;
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 my ($class, $r, $recipe, $src, $syntax) = @_ ;
37
38 my $self ;
39 my $param = $r -> component -> param ;
40 my @recipe ;
41
42 if (!$src)
43 {
44 push @recipe, {'type' => ref ($param -> input)?'memory':($param -> subreq?'apoutfilter':'file') } ;
45 }
46 else
47 {
48 push @recipe, ref $src eq 'ARRAY'?@$src:$src ;
49 }
50
51 push @recipe, {'type' => 'epparse', $syntax?(syntax => $syntax):() } ;
52 push @recipe, {'type' => 'epcompile', cache => 1 } ;
53 push @recipe, {'type' => 'eprun' } if ($param -> import < 0) ;
54
55 return \@recipe ;
56 }
57
58 1;
59
60 __END__
61
62 =pod
63
64 =head1 NAME
65
66 Embperl::Recipe::Embperl - the default Embperl recipe
67
68 =head1 SYNOPSIS
69
70
71 =head1 DESCRIPTION
72
73 Defines the default recipe for Embperl.
74
75 =head1 Author
76
77 G. Richter (richter at embperl dot org)
78
79 =head1 See Also
80
81 L<Embperl::Recipe|EmbperlRecipe.pod>