blib/lib/JiftyX/Fixtures/Script/Clean.pm untested

filter: Statementstmt 0.0% 0 / 47 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 13 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 63 CC 1 SCAR 6.9
CC
1
Cov
0%
options
2.0
before_run
2.0
run
2.0
CRAP 2.0
1 package JiftyX::Fixtures::Script::Clean;
2 our $VERSION = '0.07';
3  
4 # ABSTRACT: clean subcommand
5  
6 use warnings;
7 use strict;
8  
9 use Jifty;
10 use Jifty::Everything;
11  
12 use IO::File;
13 use File::Basename;
14 use File::Spec;
15 use File::Path;
16 use YAML qw(Dump LoadFile);
17  
18 use base qw(
19 App::CLI::Command
20 );
21  
22 my $super = 'JiftyX::Fixtures::Script';
23  
24 our $help_msg = qq{
25 Usage:
26  
27 jiftyx-fixtures clean [options]
28  
29 Options:
30  
31 -h, --help: show help
32  
33 };
34  
35 sub options {
36 my ($self) = @_;
37 return (
38 $super->options,
39 );
40 }
41  
42 sub before_run {
43 my ($self) = @_;
44  
45 $super->before_run($self);
46  
47 return;
48 }
49  
50 sub run {
51 my ($self) = @_;
52 $self->before_run();
53  
54 for (keys %{$self->{config}->{fixtures}}) {
55 my $dir = File::Spec->catfile(
56 $self->{config}->{app_root},
57 $self->{config}->{fixtures}->{$_}->{dir}
58 );
59 rmtree $dir;
60 }
61 rmdir File::Spec->catfile(
62 $self->{config}->{app_root},
63 "etc",
64 "fixtures"
65 );
66 unlink File::Spec->catfile(
67 $self->{config}->{app_root},
68 "etc",
69 "fixtures.yml"
70 );
71  
72  
73 }
74  
75 1;
76  
77 __END__