line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
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
|
|
|
1
|
|
996
|
use common::sense; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
10
|
1
|
|
|
1
|
|
425
|
use Params::Validate qw(:all); |
|
1
|
|
|
|
|
2088
|
|
|
1
|
|
|
|
|
159
|
|
11
|
1
|
|
|
1
|
|
4
|
use English; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
8
|
|
12
|
1
|
|
|
1
|
|
267
|
use Carp; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
168
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our $VERSION = '0.7.0'; # VERSION |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub create { |
17
|
1
|
|
|
1
|
0
|
779
|
my $class = shift; |
18
|
1
|
|
|
|
|
36
|
my %option = validate( |
19
|
|
|
|
|
|
|
@_, |
20
|
|
|
|
|
|
|
{ |
21
|
|
|
|
|
|
|
type => { |
22
|
|
|
|
|
|
|
type => SCALAR |
23
|
|
|
|
|
|
|
}, |
24
|
|
|
|
|
|
|
options => { |
25
|
|
|
|
|
|
|
type => HASHREF |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
); |
29
|
|
|
|
|
|
|
|
30
|
1
|
|
|
|
|
5
|
my $type = $option{type}; |
31
|
1
|
|
|
|
|
2
|
my $repo_mod = "Rex::Repositorio::Repository::$type"; |
32
|
1
|
|
|
1
|
|
16
|
eval "use $repo_mod;"; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
1
|
|
|
|
|
76
|
|
33
|
1
|
50
|
|
|
|
6
|
if ($EVAL_ERROR) { |
34
|
1
|
|
|
|
|
266
|
confess "Error loading repository type: $type. ($EVAL_ERROR)"; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
|
return $repo_mod->new( %{ $option{options} } ); |
|
0
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
1; |