blib/lib/PDL/Perldl2/Script.pm untested

filter: Statementstmt 0.0% 0 / 28 Branchbran 0.0% 0 / 8 Conditioncond 0.0% 0 / 9 MC/DCmcdc n/a Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 51 CC 5 SCAR 24.8
CC
5
Cov
0%
load_rcfile
20.0
_startup_def
6.0
BEGIN
2.0
CRAP 12.0
1 package PDL::Perldl2::Script;
2  
3 use Moose;
4  
5 use namespace::clean -except => [ qw(meta) ];
6  
7 extends 'Devel::REPL::Script';
8  
9 sub _startup_def {
10 return "PDL/default.pdl" if $^O =~ /win32/i;
11 return "PDL/default.perldlrc";
12 }
13  
14 sub load_rcfile {
15 my ($self, $rc_file) = @_;
16  
17 my $HOME = $ENV{HOME};
18 if ($^O =~ /win32/i and
19 (! defined($HOME)) or
20 (defined($HOME) and $HOME eq "")) {
21 $HOME = $ENV{USERPROFILE};
22 $HOME =~ s/\\/\//g;
23 }
24 print STDERR "load_rcfile: got \$HOME = $HOME\n";
25  
26 # get rc file name
27 my $startup_file = _startup_def();
28 foreach my $startup_suffix (qw( .pdlrc .perldlrc )) {
29 if ( -e "$HOME/$startup_suffix" ) {
30 $startup_file = "$HOME/$startup_suffix";
31 last;
32 }
33 }
34 print STDERR "load_rcfile: loading $startup_file\n";
35 $self->apply_script($startup_file);
36  
37 # load local.perldlrc if it exists
38 foreach my $local_startup_file (qw( local.pdlrc local.perldlrc )) {
39 if ( -e $local_startup_file ) {
40 print STDERR "load_rcfile: loading $local_startup_file\n";
41 $self->apply_script($local_startup_file);
42 last;
43 }
44 }
45 }
46  
47 # Global and local startup
48  
49 1;