line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Otogiri::Plugin; |
2
|
4
|
|
|
4
|
|
285736
|
use 5.008005; |
|
4
|
|
|
|
|
16
|
|
|
4
|
|
|
|
|
162
|
|
3
|
4
|
|
|
4
|
|
25
|
use strict; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
117
|
|
4
|
4
|
|
|
4
|
|
20
|
use warnings; |
|
4
|
|
|
|
|
18
|
|
|
4
|
|
|
|
|
154
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = "0.03"; |
7
|
|
|
|
|
|
|
|
8
|
4
|
|
|
4
|
|
897
|
use Otogiri; |
|
4
|
|
|
|
|
60326
|
|
|
4
|
|
|
|
|
1924
|
|
9
|
4
|
|
|
4
|
|
29
|
use Module::Load; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
36
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub load_plugin { #this code is taken from Teng/SQL::Maker's load_plugin |
12
|
3
|
|
|
3
|
1
|
40522
|
my ($class, $pkg, $opt) = @_; |
13
|
3
|
50
|
|
|
|
22
|
$pkg = $pkg =~ s/^\+// ? $pkg : "Otogiri::Plugin::$pkg"; |
14
|
3
|
|
|
|
|
22
|
Module::Load::load($pkg); |
15
|
|
|
|
|
|
|
|
16
|
3
|
50
|
|
|
|
1849
|
$class = ref($class) if ref($class); |
17
|
3
|
100
|
|
|
|
17
|
$class = 'DBIx::Otogiri' if ( $class eq 'Otogiri' ); |
18
|
|
|
|
|
|
|
|
19
|
3
|
|
100
|
|
|
93
|
my $alias = delete $opt->{alias} || +{}; |
20
|
|
|
|
|
|
|
{ |
21
|
4
|
|
|
4
|
|
634
|
no strict 'refs'; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
631
|
|
|
3
|
|
|
|
|
8
|
|
22
|
3
|
|
|
|
|
6
|
for my $method ( @{"${pkg}::EXPORT"} ){ |
|
3
|
|
|
|
|
18
|
|
23
|
6
|
|
66
|
|
|
51
|
*{$class . '::' . ($alias->{$method} || $method)} = $pkg->can($method); |
|
6
|
|
|
|
|
73
|
|
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
3
|
50
|
|
|
|
33
|
$pkg->init($class, $opt) if $pkg->can('init'); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
*Otogiri::load_plugin = \&load_plugin; |
31
|
|
|
|
|
|
|
*DBIx::Otogiri::load_plugin = \&load_plugin; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |
36
|
|
|
|
|
|
|
__END__ |