Gideon.pm

filter: Statementstmt 91.2% 52 / 57 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 66.6% 10 / 15 Podpod n/a totaltotal 84.2% 64 / 76 CC 3 SCAR 3.2
CC
3
Cov
89%
import
3.1
__ANON__
1.0
__ANON__
1.0
CRAP 1.4
« Gideon/Meta/Attribute/Trait/Inflate.pm ↑ Summary Gideon/Exceptions.pm »
1 package Gideon;
2 {
3 1 $Gideon::VERSION = '0.0.3';
4 }
5 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use Moose::Exporter;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use Gideon::Plugin::Cache;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use Gideon::Plugin::StrictMode;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use Gideon::Plugin::ResultSet;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use Gideon::Meta::Class::Trait::Persisted;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use Carp qw(croak);
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 #ABSTRACT: Data mapper for Moose classes an objects
14  
15 1 my ($import) = Moose::Exporter->build_import_methods(
16 class_metaroles => { class => ['Gideon::Meta::Class'] },
17 also => ['Moose'],
18 install => [ 'unimport', 'init_meta' ],
19 base_class_roles => ['Gideon::Meta::Class::Trait::Persisted'],
20 );
21  
22 2 ▶sub import {
Subroutine import: called CC=3 SCAR=11.2
23 2 my ( $class, %args ) = @_;
24  
25 2 ▶ if ( $args{driver} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($args{"driver"}) 2 0 2
26  
27 2 my $driver = "Gideon::Driver::$args{driver}";
28 2 eval "require $driver";
29 2 ▶ croak "Can't load driver $args{driver}: $@" if $@;
Branch: 1 branch
BranchTrueFalseTotal
if $@ 0 2 2
30  
31 2 my $cache = Gideon::Plugin::Cache->new( next => $driver->new );
32 2 my $strict = Gideon::Plugin::StrictMode->new( next => $cache );
33 2 my $result_set = Gideon::Plugin::ResultSet->new( next => $strict );
34  
35 2 my $target = caller;
36 1 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
37 0 ▶ *{"${target}::find"} = sub { $result_set->find(@_) };
Subroutine __ANON__: not called CC=1 SCAR=0.4
38 0 ▶ *{"${target}::find_one"} = sub { $result_set->find_one(@_) };
Subroutine __ANON__: not called CC=1 SCAR=0.4
39 0 ▶ *{"${target}::update"} = sub { $result_set->update(@_) };
Subroutine __ANON__: not called CC=1 SCAR=0.4
40 0 ▶ *{"${target}::remove"} = sub { $result_set->remove(@_) };
Subroutine __ANON__: not called CC=1 SCAR=0.4
41 0 ▶ *{"${target}::save"} = sub { $result_set->save(@_) };
Subroutine __ANON__: not called CC=1 SCAR=0.4
42 1 ▶ use strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
43 }
44  
45 2 @_ = ($class);
46 2 goto &$import;
47 }
48  
49 1 1;
50  
51 __END__
« Gideon/Meta/Attribute/Trait/Inflate.pm ↑ Summary Gideon/Exceptions.pm »