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   229858 use strict;
  27         69  
  27         842  
4 27     27   144 use warnings;
  27         56  
  27         650  
5 27     27   495 use 5.010;
  27         100  
6 27     27   177 use base qw( AnyEvent::FTP::Response );
  27         78  
  27         13929  
7              
8             # ABSTRACT: Response class for asynchronous ftp client
9             our $VERSION = '0.18'; # VERSION
10              
11              
12             sub get_address_and_port
13             {
14 42 50   42 1 867 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 75 if(shift->{message}->[0] =~ /^"(.*)"/)
22             {
23 7         26 my $dir = $1;
24 7         24 $dir =~ s/""/"/;
25 7         25 return $dir;
26             }
27 0         0 return;
28             }
29              
30              
31             sub get_file
32             {
33 6 100   6 1 50 return shift->{message}->[0] =~ /^FILE: (.*)/i ? $1 : ();
34             }
35              
36             1;
37              
38             __END__