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   11233 use strict;
  19         41  
  19         554  
4 19     19   92 use warnings;
  19         34  
  19         495  
5 19     19   92 use base qw(Exporter);
  19         27  
  19         5544  
6             our @EXPORT = qw(codelines);
7              
8             our $VERSION = '0.64'; # VERSION
9              
10             # return some lines of code
11             sub codelines {
12 6     6 0 4518 my($self) = shift;
13 6         16 my($filename, @lines);
14 6 100 100     58 if (!defined($_[0]) || $_[0] =~ /^\d+$/) {
15 3         20 $filename = $self->filename;
16             } else {
17 3         20 $filename = shift;
18             }
19 6         41 @lines = map { $_ -1 } @_;
  8         20  
20 6         36 my $response = $self->talk({
21             command => "codelines",
22             filename => $filename,
23             lines => \@lines,
24             });
25 6         22 return @{$response->{codelines}};
  6         118  
26             }
27              
28             1;
29              
30             __END__