blib/lib/Seis.pm

filter: Statementstmt 85.7% 12 / 14 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 89.4% 17 / 19 CC 1 SCAR 0.6
CC
1
Cov
86%
BEGIN
1.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« blib/lib/Seis/Exception.pm ↑ Summary blib/lib/Seis/Runtime.pm »
1 package Seis;
2 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 2 ▶use 5.010001;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 our $VERSION = "0.12";
8  
9 2 ▶use Seis::Exceptions;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 0 ▶use Seis::Compiler;
Subroutine BEGIN: called CC=1 SCAR=2.6
11 use Seis::Array;
12 use Seis::Bool;
13 use File::Spec;
14 use File::ShareDir ();
15  
16 my $compiler = Seis::Compiler->new();
17  
18 @Seis::INC = do {
19 my @inc;
20 unshift @inc, '.';
21 unshift @inc, 'share/seislib/' if -d 'share/seislib/'; # while building?
22 eval {
23 unshift @inc, File::Spec->catdir(File::ShareDir::dist_dir('Seis'), 'seislib');
24 };
25 if (my $env = $ENV{PERL_SEIS_LIB}) {
26 unshift @inc, split /:/, $ENV{PERL_SEIS_LIB};
27 }
28 @inc;
29 };
30  
31 unshift @INC, sub {
32 my ($self, $fname) = @_;
33 for my $inc (@Seis::INC) {
34 my $real = File::Spec->catfile($inc, $fname);
35 next unless -f $real;
36  
37 open my $fh, '<', $real or die $!;
38 my $code = do { local $/; <$fh> };
39 my $compiled = $compiler->compile($code, $real) . ";1;";
40 open my $tmpfh, '<', \$compiled;
41 return $tmpfh;
42 }
43 return;
44 };
45  
46  
47 1;
48 __END__
« blib/lib/Seis/Exception.pm ↑ Summary blib/lib/Seis/Runtime.pm »