| 1 | 4 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 2 | 4 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | |||||||||||
| 4 | package App::Embra::Role::FilePruner; | ||||||||||
| 5 | 4 | $App::Embra::Role::FilePruner::VERSION = '0.001'; # TRIAL | |||||||||
| 6 | # ABSTRACT: something that stops files from appearing in a site | ||||||||||
| 7 | |||||||||||
| 8 | 4 | ▶ | use List::MoreUtils qw< part >; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 4 | ▶ | use Method::Signatures; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 4 | ▶ | use Moo::Role; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | |||||||||||
| 12 | |||||||||||
| 13 | 4 | with 'App::Embra::Role::Plugin'; | |||||||||
| 14 | |||||||||||
| 15 | 4 | requires 'exclude_file'; | |||||||||
| 16 | |||||||||||
| 17 | |||||||||||
| 18 | 4 | ▶ | method prune_files { | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
prune_files: called CC=3 SCAR=11.0
Branch: 1 branch
| |||||||||||
| 19 | 3 | my $files = $self->embra->files; | |||||||||
| 20 | 3 | ▶ | my ($remove, $keep) = part { ! $self->exclude_file( $_ ) } @{ $files }; | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 21 | |||||||||||
| 22 | 3 | $self->debug( "pruning $_" ) for @{ $remove }; | |||||||||
| 23 | 3 | splice @{ $files }, 0, @{ $files }, @{ $keep }; | |||||||||
| 24 | |||||||||||
| 25 | 3 | return; | |||||||||
| 26 | } | ||||||||||
| 27 | |||||||||||
| 28 | 4 | 1; | |||||||||
| 29 | |||||||||||
| 30 | __END__ | ||||||||||