File Coverage

blib/lib/Alien/SWIProlog.pm
Criterion Covered Total %
statement 21 21 100.0
branch n/a
condition n/a
subroutine 7 7 100.0
pod n/a
total 28 28 100.0


line stmt bran cond sub pod time code
1             package Alien::SWIProlog;
2             # ABSTRACT: Alien package for the SWI-Prolog Prolog interpreter
3             $Alien::SWIProlog::VERSION = '0.002';
4 1     1   298852 use strict;
  1         3  
  1         21  
5 1     1   4 use warnings;
  1         2  
  1         19  
6              
7 1     1   5 use base qw(Alien::Base);
  1         1  
  1         413  
8 1     1   5094 use Role::Tiny::With qw( with );
  1         6607  
  1         56  
9 1     1   1208 use Class::Method::Modifiers;
  1         1780  
  1         61  
10 1     1   564 use Alien::SWIProlog::Util;
  1         4  
  1         26  
11 1         7 use Env qw(
12             $SWI_HOME_DIR
13 1     1   5 );
  1         1  
14              
15             with 'Alien::Role::Dino';
16              
17             before import => sub {
18             my $class = shift;
19              
20             $SWI_HOME_DIR = $class->runtime_prop->{home};
21             my @swi_lib_dirs = $class->rpath;
22             require DynaLoader;
23             unshift @DynaLoader::dl_library_path, @swi_lib_dirs;
24             my ($dlfile) = DynaLoader::dl_findfile('-lswipl');
25             DynaLoader::dl_load_file($dlfile);
26             };
27              
28             1;
29              
30             __END__