File Coverage

blib/lib/Puppet/Body.pm
Criterion Covered Total %
statement 74 80 92.5
branch 19 34 55.8
condition n/a
subroutine 16 16 100.0
pod 8 10 80.0
total 117 140 83.5


line stmt bran cond sub pod time code
1             ############################################################
2             #
3             # $Header: /home/domi/Tools/perlDev/Puppet_Body/lib/Puppet/RCS/Body.pm,v 1.15 1999/05/27 11:54:35 domi Exp $
4             #
5             # $Source: /home/domi/Tools/perlDev/Puppet_Body/lib/Puppet/RCS/Body.pm,v $
6             # $Revision: 1.15 $
7             # $Locker: $
8             #
9             ############################################################
10              
11             package Puppet::Body ;
12              
13 2     2   18158 use Carp ;
  2         5  
  2         199  
14 2     2   1888 use AutoLoader 'AUTOLOAD' ;
  2         3377  
  2         13  
15 2     2   1601 use Puppet::LogBody ;
  2         1341  
  2         68  
16              
17 2     2   13 use strict ;
  2         4  
  2         68  
18 2     2   11 use vars qw($VERSION $_index) ;
  2         3  
  2         977  
19             $VERSION = sprintf "%d.%03d", q$Revision: 1.15 $ =~ /(\d+)\.(\d+)/;
20             $_index = 1 ;
21              
22             sub new
23             {
24 8     8 1 1203 my $type = shift ;
25 8         24 my $self = {} ;
26 8         23 my %args = @_ ;
27            
28 8         16 foreach (qw/name cloth/)
29             {
30 16         55 $self->{$_} = delete $args{$_} ;
31             }
32              
33 8 100       30 $self->{name}='anonymous'.$_index++ unless defined $self->{name} ;
34 8 50       21 die "no 'cloth' parameter defined for body $self->{name}\n" unless
35             defined $self->{cloth};
36 8         17 bless $self,$type ;
37              
38 8         31 $self->_createLogs($args{how}) ;
39              
40 8         133 return $self;
41             }
42              
43 6     6 1 48 sub cloth { return shift->{cloth};}
44              
45             sub _createLogs
46             {
47 8     8   87 my $self = shift ;
48 8         18 my $how = shift ;
49              
50             # config debug window
51 8         14 foreach (qw/debug event/)
52             {
53 16         133 my $what = $_ ;
54 16         58 $self->{'log'}{$_} = new Puppet::LogBody
55             (
56             name => $_,
57             how => $how
58             );
59             }
60             }
61              
62             1;
63              
64             __END__