File Coverage

blib/lib/AnyEvent/FTP/Client/Site.pm
Criterion Covered Total %
statement 29 29 100.0
branch 1 2 50.0
condition n/a
subroutine 8 9 88.8
pod 0 1 0.0
total 38 41 92.6


line stmt bran cond sub pod time code
1             package AnyEvent::FTP::Client::Site;
2              
3 2     2   162267 use strict;
  2         7  
  2         42  
4 2     2   7 use warnings;
  2         4  
  2         30  
5 2     2   24 use 5.010;
  2         5  
6              
7             # ABSTRACT: Dispatcher for site specific ftp commands
8             our $VERSION = '0.19'; # VERSION
9              
10             sub new
11             {
12 1     1 0 70 my($class, $client) = @_;
13 1         3 bless { client => $client }, $class;
14             }
15              
16             sub AUTOLOAD
17             {
18 3     3   5859 our $AUTOLOAD;
19 3         5 my $self = shift;
20 3         5 my $name = $AUTOLOAD;
21 3         14 $name =~ s/^.*://;
22 3         8 $name =~ s/_(.)/uc $1/eg;
  2         6  
23 3         11 my $class = join('::', qw( AnyEvent FTP Client Site ), ucfirst($name) );
24 3     1   143 eval qq{ use $class () };
  1     1   319  
  1     1   2  
  1         12  
  1         339  
  1         2  
  1         8  
  1         340  
  1         2  
  1         8  
25 3 50       9 die $@ if $@;
26 3         42 $class->new($self->{client});
27             }
28              
29             # don't autoload DESTROY
30       0     sub DESTROY { }
31              
32             1;
33              
34             __END__