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   252393 use strict;
  2         14  
  2         65  
4 2     2   11 use warnings;
  2         4  
  2         53  
5 2     2   49 use 5.010;
  2         6  
6              
7             # ABSTRACT: Dispatcher for site specific ftp commands
8             our $VERSION = '0.18'; # VERSION
9              
10             sub new
11             {
12 1     1 0 98 my($class, $client) = @_;
13 1         6 bless { client => $client }, $class;
14             }
15              
16             sub AUTOLOAD
17             {
18 3     3   8566 our $AUTOLOAD;
19 3         8 my $self = shift;
20 3         8 my $name = $AUTOLOAD;
21 3         21 $name =~ s/^.*://;
22 3         13 $name =~ s/_(.)/uc $1/eg;
  2         9  
23 3         19 my $class = join('::', qw( AnyEvent FTP Client Site ), ucfirst($name) );
24 3     1   231 eval qq{ use $class () };
  1     1   481  
  1     1   4  
  1         66  
  1         542  
  1         3  
  1         12  
  1         454  
  1         3  
  1         12  
25 3 50       14 die $@ if $@;
26 3         61 $class->new($self->{client});
27             }
28              
29             # don't autoload DESTROY
30       0     sub DESTROY { }
31              
32             1;
33              
34             __END__