Repositorio/Repository_Factory.pm

filter: Statementstmt 96.1% 25 / 26 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 1 totaltotal 91.4% 32 / 35 CC 2 SCAR 2.5
CC
2
Cov
93%
create
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« Repositorio/Server/Yum.pm ↑ Summary
1 #
2 # (c) Jan Gehring <jan.gehring@gmail.com>
3 #
4 # vim: set ts=2 sw=2 tw=0:
5 # vim: set expandtab:
6  
7 package Rex::Repositorio::Repository_Factory;
8  
9 1 ▶use common::sense;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use Params::Validate qw(:all);
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use English;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 1 our $VERSION = '1.2.1'; # VERSION
15  
16 1 ▶sub create {
Subroutine create: called CC=2 SCAR=7.0
Pod undocumented
17 1 my $class = shift;
18 1 my %option = validate(
19 @_,
20 {
21 type => {
22 type => SCALAR
23 },
24 options => {
25 type => HASHREF
26 }
27 }
28 );
29  
30 1 my $type = $option{type};
31 1 my $repo_mod = "Rex::Repositorio::Repository::$type";
32 1 ▶ eval "use $repo_mod;1;";
Subroutine BEGIN: called CC=1 SCAR=0.0
33 1 ▶ if ($EVAL_ERROR) {
Branch: 1 branch
BranchTrueFalseTotal
if ($Rex::Repositorio::Repository_Factory::EVAL_ERROR) 0 1 1
34 0 confess "Error loading repository type: $type. ($EVAL_ERROR)";
35 }
36  
37 1 return $repo_mod->new( %{ $option{options} } );
38 }
39  
40 1 1;
« Repositorio/Server/Yum.pm ↑ Summary