Evo/Export.pm

filter: Statementstmt 75.0% 3 / 4 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 1 / 2 Podpod n/a totaltotal 66.6% 4 / 6 SCAR 0.2
CC
1
Cov
75%
install_in
2.0
BEGIN
1.0
CRAP 1.0
« Evo/Internal/Exception.pm ↑ Summary Evo/Class.pm »
1 package Evo::Export;
2 42 ▶use Evo '::Meta';
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4  
5 my $META = Evo::Export::Meta->find_or_bind_to(__PACKAGE__);
6  
7 ▶sub install_in ($me, $dest, $from, @list) {
Subroutine install_in: not called CC=1 SCAR=6.9
8 0 Evo::Export::Meta->find_or_bind_to($from)->install($dest, @list);
9 }
10  
11 sub Export ($pkg, $code, $name, $as = $name) : Attr {
12 $name or (undef, $name) = Evo::Lib::Bare::code2names($code);
13 Evo::Export::Meta->find_or_bind_to($pkg)->export_code($as, $code);
14 }
15  
16 sub ExportGen ($pkg, $gen, $name, $as = $name) : Attr {
17 $name or (undef, $name) = Evo::Lib::Bare::code2names($gen);
18 Evo::Export::Meta->find_or_bind_to($pkg)->export_gen($as, $gen);
19 }
20  
21 sub import ($self, @list) {
22 my $dest = scalar caller;
23 Evo::Export::Meta->find_or_bind_to($dest);
24 @list = ('*') unless @list;
25 Evo::Export::Meta->find_or_bind_to($self)->install($dest, @list);
26 }
27  
28 sub _import ($self, @list) : Export(import) {
29 my $dest = scalar caller;
30 Evo::Export::Meta->find_or_bind_to($self)->install($dest, @list);
31 }
32  
33  
34 sub EXPORT ($me, $dest) : ExportGen {
35 sub {
36 Evo::Export::Meta->find_or_bind_to($dest);
37 };
38 }
39  
40 sub import_all ($exporter, @list) : Export {
41 @list = ('*') unless @list;
42 Evo::Export::Meta->find_or_bind_to($exporter)->install(scalar caller, @list);
43 }
44  
45 sub export_gen ($me, $dst) : ExportGen {
46 sub ($name, $gen) {
47 Evo::Export::Meta->find_or_bind_to($dst)->export_gen($name, $gen);
48 };
49 }
50  
51 sub export_code ($me, $dst) : ExportGen {
52 sub ($name, $fn) {
53 Evo::Export::Meta->find_or_bind_to($dst)->export_code($name, $fn);
54 };
55 }
56  
57 sub export ($me, $dst) : ExportGen {
58 sub { Evo::Export::Meta->find_or_bind_to($dst)->export($_) for @_ }
59 }
60  
61 sub export_proxy ($me, $dst) : ExportGen {
62 sub ($origpkg, @list) {
63 Evo::Export::Meta->find_or_bind_to($dst)->export_proxy($origpkg, @list);
64 };
65 }
66  
67  
68 1;
69  
70 __END__
« Evo/Internal/Exception.pm ↑ Summary Evo/Class.pm »