File Coverage

lib/Devel/ebug/Plugin/Codelines.pm
Criterion Covered Total %
statement 19 19 100.0
branch 2 2 100.0
condition 3 3 100.0
subroutine 4 4 100.0
pod 0 1 0.0
total 28 29 96.5


line stmt bran cond sub pod time code
1             package Devel::ebug::Plugin::Codelines;
2              
3 19     19   10506 use strict;
  19         41  
  19         515  
4 19     19   88 use warnings;
  19         25  
  19         554  
5 19     19   92 use base qw(Exporter);
  19         33  
  19         5300  
6             our @EXPORT = qw(codelines);
7              
8             our $VERSION = '0.62_01'; # TRIAL VERSION
9             $VERSION = eval $VERSION; ## no critic (BuiltinFunctions::ProhibitStringyEval)
10              
11             # return some lines of code
12             sub codelines {
13 6     6 0 3897 my($self) = shift;
14 6         13 my($filename, @lines);
15 6 100 100     47 if (!defined($_[0]) || $_[0] =~ /^\d+$/) {
16 3         13 $filename = $self->filename;
17             } else {
18 3         17 $filename = shift;
19             }
20 6         38 @lines = map { $_ -1 } @_;
  8         19  
21 6         37 my $response = $self->talk({
22             command => "codelines",
23             filename => $filename,
24             lines => \@lines,
25             });
26 6         22 return @{$response->{codelines}};
  6         87  
27             }
28              
29             1;
30              
31             __END__