File Coverage

blib/lib/Rex/Apache/Deploy/Package/Base.pm
Criterion Covered Total %
statement 15 30 50.0
branch 0 4 0.0
condition 0 11 0.0
subroutine 5 8 62.5
pod 0 2 0.0
total 20 55 36.3


line stmt bran cond sub pod time code
1             #
2             # (c) Jan Gehring
3             #
4             # vim: set ts=2 sw=2 tw=0:
5             # vim: set expandtab:
6              
7             package Rex::Apache::Deploy::Package::Base;
8              
9 1     1   1616 use strict;
  1         3  
  1         33  
10 1     1   6 use warnings;
  1         2  
  1         31  
11              
12 1     1   7 use Rex::Commands::Gather;
  1         3  
  1         45  
13              
14             sub new {
15 0     0 0   my $that = shift;
16 0   0       my $proto = ref($that) || $that;
17 0           my $self = {@_};
18              
19 0           bless( $self, $proto );
20              
21 0           my %sys_info = get_system_information();
22              
23 0   0       $self->{arch} ||= $sys_info{architecture}, $self->{version} ||= "1.0";
      0        
24              
25 0           return $self;
26             }
27              
28             for my $name (
29             qw/
30             path
31             source
32             release
33             epoch
34             version
35             arch
36             name
37             file_user
38             file_group
39             /
40             )
41             {
42 1     1   510 no strict 'refs';
  1         1  
  1         99  
43             *{ __PACKAGE__ . "::$name" } = sub {
44 0     0     my ( $self, $data ) = @_;
45              
46 0 0         if ($data) {
47 0           $self->{$name} = $data;
48             }
49              
50 0           $self->{$name};
51              
52             };
53 1     1   5 use strict;
  1         2  
  1         88  
54             }
55              
56             sub prefix {
57 0     0 0   my ( $self, $prefix ) = @_;
58              
59 0 0         if ($prefix) {
60 0           $self->{prefix} = $prefix;
61             }
62              
63 0   0       return $self->{prefix} || $self->{path};
64             }
65              
66             1;