IPerl.pm

filter: Statementstmt 100% 38 / 38 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 10 / 10 Podpod 33.3% 1 / 3 totaltotal 94.3% 50 / 53 CC 2 SCAR 1.7
CC
2
Cov
98%
helper
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« Devel/IPerl/Display/TeX.pm ↑ Summary Devel/IPerl/Plugin/DataFrame.pm »
1 package # hide from PAUSE
2 IPerl;
3  
4 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 with qw( MooX::Singleton );
8  
9 2 our $REPL;
10 2 our $current_msg;
11  
12 2 ▶has helpers => ( is => 'rw', default => sub { +{} } );
Subroutine __ANON__: called CC=1 SCAR=0.0
13  
14 18 ▶sub helper {
Subroutine helper: called CC=2 SCAR=7.0
Pod documented
15 18 my ($class, $name, $cb) = @_;
16 18 my $self = $class->instance;
17 warn (qq{Helper "$name" already exists, replacing.})
18 18 ▶ if exists $self->helpers->{$name};
Branch: 1 branch
BranchTrueFalseTotal
if exists $self->helpers->{$name} 0 18 18
19 18 $self->add_helper($name => $cb);
20 }
21  
22 18 ▶sub add_helper {
Subroutine add_helper: called CC=1 SCAR=0.0
Pod undocumented
23 18 my ($self, $name, $cb) = @_;
24 18 $self->helpers->{$name} = $cb;
25 {
26 2 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
27 2 ▶ no warnings 'redefine';
Subroutine BEGIN: called CC=1 SCAR=0.0
28 18 *{"IPerl::$name"} = $cb;
29 }
30 }
31  
32 5 ▶sub load_plugin {
Subroutine load_plugin: called CC=1 SCAR=0.0
Pod undocumented
33 5 my ($class, $plugin_name) = @_;
34 5 my $plugin_package = "Devel::IPerl::Plugin::$plugin_name";
35 2 ▶ { no strict; eval "require $plugin_package"; }
Subroutine BEGIN: called CC=1 SCAR=0.0
36 5 $plugin_package->register( $class );
37 }
38  
39 2 1;
40  
41 __END__
« Devel/IPerl/Display/TeX.pm ↑ Summary Devel/IPerl/Plugin/DataFrame.pm »