| 1 | 5 | ▶ | use v5.14.0; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 2 | 5 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||
| 4 | package OS::Package::Role::Clean; | ||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | # ABSTRACT: Provides the clean method. | ||||||||||||||||||||||||||||
| 7 | 5 | our $VERSION = '0.2.6'; # VERSION | |||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 5 | ▶ | use Path::Tiny; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | 5 | ▶ | use OS::Package::Log; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | 5 | ▶ | use Role::Tiny; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | sub clean { | ||||||||||||||||||||||||||||
| 14 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
clean: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | 0 | ▶ | if ( defined $self->workdir && -d $self->workdir ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $self->workdir and -d $self->workdir
MC/DC0%0/2
defined $self->workdir and -d $self->workdir
defined $self->workdir
-d $self->workdir
Truth table0%0/3
A and B
A= defined $self->workdirB= -d $self->workdir
| |||||||||||||||||||||||||||||
| 17 | 0 | $LOGGER->info( sprintf 'cleaning work directory: %s', | |||||||||||||||||||||||||||
| 18 | $self->workdir ); | ||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | 0 | path($self->workdir)->remove_tree; | |||||||||||||||||||||||||||
| 21 | } | ||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | 0 | ▶ | if ( defined $self->fakeroot && -d $self->fakeroot ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $self->fakeroot and -d $self->fakeroot
MC/DC0%0/2
defined $self->fakeroot and -d $self->fakeroot
defined $self->fakeroot
-d $self->fakeroot
Truth table0%0/3
A and B
A= defined $self->fakerootB= -d $self->fakeroot
| |||||||||||||||||||||||||||||
| 24 | 0 | $LOGGER->info( sprintf 'cleaning fakeroot directory: %s', | |||||||||||||||||||||||||||
| 25 | $self->fakeroot ); | ||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | 0 | path($self->fakeroot)->remove_tree; | |||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | 0 | return 1; | |||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | 5 | 1; | |||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | __END__ | ||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | =pod | ||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | =encoding UTF-8 | ||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | =head1 NAME | ||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | OS::Package::Role::Clean - Provides the clean method. | ||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||
| 45 | =head1 VERSION | ||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | version 0.2.6 | ||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||
| 49 | =head1 METHODS | ||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||
| 51 | =head2 clean | ||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | Provides method to clean the fakeroot directory. | ||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | =head1 AUTHOR | ||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||
| 57 | James F Wilkus <jfwilkus@cpan.org> | ||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||
| 59 | =head1 COPYRIGHT AND LICENSE | ||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||
| 61 | This software is Copyright (c) 2014 by James F Wilkus. | ||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||
| 63 | This is free software, licensed under: | ||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||
| 65 | The (three-clause) BSD License | ||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||
| 67 | =cut | ||||||||||||||||||||||||||||