File Coverage

blib/lib/Rex/Apache/Deploy/Package/Base.pm
Criterion Covered Total %
statement 7 9 77.7
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 10 12 83.3


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