File Coverage

blib/lib/AnyEvent/FTP/Client/Response.pm
Criterion Covered Total %
statement 17 19 89.4
branch 4 6 66.6
condition n/a
subroutine 7 7 100.0
pod 3 3 100.0
total 31 35 88.5


line stmt bran cond sub pod time code
1             package AnyEvent::FTP::Client::Response;
2              
3 27     27   171190 use strict;
  27         52  
  27         612  
4 27     27   106 use warnings;
  27         54  
  27         466  
5 27     27   330 use 5.010;
  27         78  
6 27     27   134 use base qw( AnyEvent::FTP::Response );
  27         50  
  27         9387  
7              
8             # ABSTRACT: Response class for asynchronous ftp client
9             our $VERSION = '0.19'; # VERSION
10              
11              
12             sub get_address_and_port
13             {
14 42 50   42 1 645 return ("$1.$2.$3.$4", $5*256+$6) if shift->{message}->[0] =~ /\((\d+),(\d+),(\d+),(\d+),(\d+),(\d+)\)/;
15 0         0 return;
16             }
17              
18              
19             sub get_dir
20             {
21 7 50   7 1 48 if(shift->{message}->[0] =~ /^"(.*)"/)
22             {
23 7         21 my $dir = $1;
24 7         14 $dir =~ s/""/"/;
25 7         19 return $dir;
26             }
27 0         0 return;
28             }
29              
30              
31             sub get_file
32             {
33 6 100   6 1 39 return shift->{message}->[0] =~ /^FILE: (.*)/i ? $1 : ();
34             }
35              
36             1;
37              
38             __END__