File Coverage

blib/lib/App/cpanmigrate/csh.pm
Criterion Covered Total %
statement 8 8 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod 0 1 0.0
total 11 12 91.6


line stmt bran cond sub pod time code
1             package App::cpanmigrate::csh;
2 2     2   1161 use strict;
  2         4  
  2         64  
3 2     2   617 use warnings;
  2         4  
  2         237  
4              
5             sub script {
6 1     1 0 9 my ($class, $version) = @_;
7              
8 1         8 return <<"EOS";
9             echo "@@@@@ Start migration to $version"; sleep 1;
10              
11             echo "@@@@@ Installing ExtUtils::Installed"; sleep 1;
12             cpanm ExtUtils::Installed;
13              
14             echo "@@@@@ Extracting all modules"; sleep 1;
15             if ( -e /tmp/modules.list ) rm /tmp/modules.list;
16             perl -MExtUtils::Installed -E 'say for ExtUtils::Installed->new->modules' > /tmp/modules.list;
17              
18             echo "@@@@@ Upgrading perlbrew"; sleep 1;
19             curl -L http://xrl.us/perlbrewinstall | bash;
20             source ~/perl5/perlbrew/etc/cshrc;
21              
22             echo "@@@@@ Installing $version"; sleep 1;
23             perlbrew install "$version" -v &&
24              
25             echo "@@@@@ Switching new environment"; sleep 1;
26             perlbrew switch "$version" &&
27             source ~/perl5/perlbrew/etc/cshrc;
28              
29             echo "@@@@@ Installing cpanminus for new environment"; sleep 1;
30             perlbrew install-cpanm &&
31              
32             echo "@@@@@ Installing all modules into new environment"; sleep 1;
33             cpanm < /tmp/modules.list;
34              
35             echo "@@@@@ Re-running cpanminus to check everything is OK"; sleep 1;
36             cpanm < /tmp/modules.list;
37              
38             echo "@@@@@ Done migration!";
39             perl -V;
40             EOS
41             }
42              
43             1;