| 1 | package XT::Files::Plugin::Default; | ||||||||||
| 2 | |||||||||||
| 3 | 6 | ▶ | use 5.006; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 6 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 6 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 6 | our $VERSION = '0.001'; | |||||||||
| 8 | |||||||||||
| 9 | 6 | ▶ | use parent 'XT::Files::Plugin'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | sub run { | ||||||||||
| 12 | 7 | ▶ | my ( $self, $args ) = @_; | ||||||||
|
Subroutine
run: called CC=6 SCAR=17.9
Pod
documented
| |||||||||||
| 13 | |||||||||||
| 14 | 7 | my $dirs = 1; | |||||||||
| 15 | 7 | my $excludes = 1; | |||||||||
| 16 | |||||||||||
| 17 | ARG: | ||||||||||
| 18 | 7 | for my $arg ( @{$args} ) { | |||||||||
| 19 | 4 | my ( $key, $value ) = @{$arg}; | |||||||||
| 20 | |||||||||||
| 21 | 4 | ▶ | if ( $key eq 'dirs' ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 22 | 2 | $dirs = !!$value; | |||||||||
| 23 | 2 | next ARG; | |||||||||
| 24 | } | ||||||||||
| 25 | |||||||||||
| 26 | 2 | ▶ | if ( $key eq 'excludes' ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 27 | 1 | $excludes = !!$value; | |||||||||
| 28 | 1 | next ARG; | |||||||||
| 29 | } | ||||||||||
| 30 | |||||||||||
| 31 | 1 | $self->log_fatal("Invalid configuration option '$key = $value' for plugin 'Default'"); | |||||||||
| 32 | } | ||||||||||
| 33 | |||||||||||
| 34 | 6 | my $xtf = $self->xtf; | |||||||||
| 35 | |||||||||||
| 36 | 6 | ▶ | if ($excludes) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 37 | 5 | $xtf->plugin( 'Excludes', undef, [ map { [ 'exclude' => $_ ] } (qw([.]swp$ [.]bak$ ~$)) ] ); | |||||||||
| 38 | } | ||||||||||
| 39 | |||||||||||
| 40 | 6 | ▶ | if ($dirs) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 41 | 4 | $xtf->plugin( | |||||||||
| 42 | 'Dirs', undef, | ||||||||||
| 43 | [ | ||||||||||
| 44 | [ bin => 'bin' ], | ||||||||||
| 45 | [ bin => 'script' ], | ||||||||||
| 46 | [ module => 'lib' ], | ||||||||||
| 47 | ], | ||||||||||
| 48 | ); | ||||||||||
| 49 | } | ||||||||||
| 50 | |||||||||||
| 51 | 6 | return; | |||||||||
| 52 | } | ||||||||||
| 53 | |||||||||||
| 54 | 6 | 1; | |||||||||
| 55 | |||||||||||
| 56 | __END__ | ||||||||||