File Coverage

lib/Devel/ebug/Plugin/Eval.pm
Criterion Covered Total %
statement 15 15 100.0
branch 2 2 100.0
condition n/a
subroutine 5 5 100.0
pod 0 2 0.0
total 22 24 91.6


line stmt bran cond sub pod time code
1             package Devel::ebug::Plugin::Eval;
2              
3 19     19   10742 use strict;
  19         40  
  19         524  
4 19     19   93 use warnings;
  19         33  
  19         476  
5 19     19   86 use base qw(Exporter);
  19         28  
  19         4778  
6             our @EXPORT = qw(eval yaml);
7              
8             our $VERSION = '0.62_01'; # TRIAL VERSION
9             $VERSION = eval $VERSION; ## no critic (BuiltinFunctions::ProhibitStringyEval)
10              
11             # eval
12             sub eval {
13 11     11 0 9150 my($self, $eval) = @_;
14 11         147 my $response = $self->talk({
15             command => "eval",
16             eval => $eval,
17             });
18             return wantarray ? ( $response->{eval}, $response->{exception} ) : ## no critic (Freenode::Wantarray)
19 11 100       204 $response->{eval};
20             }
21              
22             # yaml
23             sub yaml {
24 1     1 0 3 my($self, $yaml) = @_;
25 1         6 my $response = $self->talk({
26             command => "yaml",
27             yaml => $yaml,
28             });
29 1         10 return $response->{yaml};
30             }
31              
32             1;
33              
34             __END__