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   11101 use strict;
  19         42  
  19         590  
4 19     19   91 use warnings;
  19         34  
  19         509  
5 19     19   89 use base qw(Exporter);
  19         33  
  19         5261  
6             our @EXPORT = qw(codelines);
7              
8             our $VERSION = '0.63'; # VERSION
9              
10             # return some lines of code
11             sub codelines {
12 6     6 0 4130 my($self) = shift;
13 6         14 my($filename, @lines);
14 6 100 100     56 if (!defined($_[0]) || $_[0] =~ /^\d+$/) {
15 3         21 $filename = $self->filename;
16             } else {
17 3         22 $filename = shift;
18             }
19 6         40 @lines = map { $_ -1 } @_;
  8         22  
20 6         46 my $response = $self->talk({
21             command => "codelines",
22             filename => $filename,
23             lines => \@lines,
24             });
25 6         25 return @{$response->{codelines}};
  6         112  
26             }
27              
28             1;
29              
30             __END__