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   172778 use strict;
  27         56  
  27         1071  
4 27     27   135 use warnings;
  27         66  
  27         1356  
5 27     27   482 use 5.010;
  27         106  
6 27     27   175 use base qw( AnyEvent::FTP::Response );
  27         54  
  27         14753  
7              
8             # ABSTRACT: Response class for asynchronous ftp client
9             our $VERSION = '0.20'; # VERSION
10              
11              
12             sub get_address_and_port
13             {
14 42 50   42 1 1041 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 45 if(shift->{message}->[0] =~ /^"(.*)"/)
22             {
23 7         18 my $dir = $1;
24 7         14 $dir =~ s/""/"/;
25 7         48 return $dir;
26             }
27 0         0 return;
28             }
29              
30              
31             sub get_file
32             {
33 6 100   6 1 54 return shift->{message}->[0] =~ /^FILE: (.*)/i ? $1 : ();
34             }
35              
36             1;
37              
38             __END__