File Coverage

blib/lib/Nephia/Setup/Plugin/Assets/Bootstrap.pm
Criterion Covered Total %
statement 30 30 100.0
branch n/a
condition n/a
subroutine 9 9 100.0
pod 1 1 100.0
total 40 40 100.0


line stmt bran cond sub pod time code
1             package Nephia::Setup::Plugin::Assets::Bootstrap;
2 2     2   3218 use 5.008005;
  2         7  
  2         82  
3 2     2   12 use strict;
  2         4  
  2         70  
4 2     2   23 use warnings;
  2         6  
  2         85  
5 2     2   998 use parent 'Nephia::Setup::Plugin';
  2         382  
  2         23  
6 2     2   7055 use File::ShareDir ':ALL';
  2         10310  
  2         515  
7 2     2   1332 use File::Copy;
  2         3217  
  2         164  
8 2     2   16 use File::Spec;
  2         4  
  2         561  
9              
10             our $VERSION = "0.04";
11             our $ARCHIVE_FILENAME = 'bootstrap-2.3.2.zip';
12              
13             sub fix_setup {
14 1     1 1 34 my $self = shift;
15 1         8 $self->setup->action_chain->append('Assets::Bootstrap' => \&_assets_bootstrap);
16             }
17              
18             sub _assets_bootstrap {
19 1     1   370 my ($setup, $context) = @_;
20 1         2 my $dist = __PACKAGE__;
21 1         5 $dist =~ s/\:\:/\-/g;
22 1         6 my $src = dist_file($dist, $ARCHIVE_FILENAME);
23 1         197 my $dst = File::Spec->catfile($setup->approot, $ARCHIVE_FILENAME);
24 1         19 copy($src, $dst);
25 1         1086 $setup->assets_archive($ARCHIVE_FILENAME, qw/static/);
26             }
27              
28             1;
29             __END__