| 1 | package AnyEvent::FTP::Server::Role::Type; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 24 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 24 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 24 | ▶ | use 5.010; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 24 | ▶ | use Moo::Role; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | # ABSTRACT: Type role for FTP server | ||||||||||||||||||||||||||||
| 9 | 24 | our $VERSION = '0.19'; # VERSION | |||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | has type => ( | ||||||||||||||||||||||||||||
| 13 | is => 'rw', | ||||||||||||||||||||||||||||
| 14 | 68 | ▶ | default => sub { 'A' }, | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 15 | 24 | ); | |||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | 3 | ▶ | sub help_type { 'TYPE <sp> type-code (A, I)' } | ||||||||||||||||||||||||||
|
Subroutine
help_type: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | sub cmd_type | ||||||||||||||||||||||||||||
| 21 | { | ||||||||||||||||||||||||||||
| 22 | 30 | ▶ | my($self, $con, $req) = @_; | ||||||||||||||||||||||||||
|
Subroutine
cmd_type: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | 30 | my $type = uc $req->args; | |||||||||||||||||||||||||||
| 25 | 30 | $type =~ s/^\s+//; | |||||||||||||||||||||||||||
| 26 | 30 | $type =~ s/\s+$//; | |||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | 30 | ▶ | if($type eq 'A' || $type eq 'I') | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$type eq "A" or $type eq "I"
MC/DC100%2/2
$type eq "A" or $type eq "I"
$type eq "A"
$type eq "I"
Truth table100%3/3
A or B
A= $type eq "A"B= $type eq "I"
| |||||||||||||||||||||||||||||
| 29 | { | ||||||||||||||||||||||||||||
| 30 | 28 | $self->type($type); | |||||||||||||||||||||||||||
| 31 | 28 | $con->send_response(200 => "Type set to $type"); | |||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||
| 33 | else | ||||||||||||||||||||||||||||
| 34 | { | ||||||||||||||||||||||||||||
| 35 | 2 | $con->send_response(500 => "Type not understood"); | |||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | 30 | $self->done; | |||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | # TODO: STRU MODE | ||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | 24 | 1; | |||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||
| 45 | __END__ | ||||||||||||||||||||||||||||