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.001_02'; # TRIAL
4             $Alien::SWIProlog::VERSION = '0.00102';
5 1     1   309325 use strict;
  1         3  
  1         24  
6 1     1   6 use warnings;
  1         2  
  1         23  
7              
8 1     1   4 use base qw(Alien::Base);
  1         2  
  1         495  
9 1     1   4879 use Role::Tiny::With qw( with );
  1         4247  
  1         45  
10 1     1   449 use Class::Method::Modifiers;
  1         1331  
  1         51  
11 1     1   431 use Alien::SWIProlog::Util;
  1         2  
  1         27  
12 1         5 use Env qw(
13             $SWI_HOME_DIR
14 1     1   6 );
  1         2  
15              
16             with 'Alien::Role::Dino';
17              
18             before import => sub {
19             my $class = shift;
20              
21             $SWI_HOME_DIR = $class->runtime_prop->{home};
22             my @swi_lib_dirs = $class->rpath;
23             require DynaLoader;
24             unshift @DynaLoader::dl_library_path, @swi_lib_dirs;
25             my ($dlfile) = DynaLoader::dl_findfile('-lswipl');
26             DynaLoader::dl_load_file($dlfile);
27             };
28              
29             1;
30              
31             __END__