File Coverage

blib/lib/Alien/Base/Dino.pm
Criterion Covered Total %
statement 27 28 96.4
branch 2 4 50.0
condition 1 3 33.3
subroutine 8 8 100.0
pod 2 2 100.0
total 40 45 88.8


line stmt bran cond sub pod time code
1             package Alien::Base::Dino;
2              
3 3     3   274056 use strict;
  3         9  
  3         96  
4 3     3   20 use warnings;
  3         7  
  3         90  
5 3     3   57 use 5.008001;
  3         18  
6 3     3   19 use base qw( Alien::Base );
  3         8  
  3         1702  
7              
8             # ABSTRACT: Experimental support for dynamic share Alien install
9             our $VERSION = '0.01'; # VERSION
10              
11              
12             sub import
13       2     {
14             # We do NOT support the legacy Alien::Base interface for loading
15             # DLLs.
16             }
17              
18              
19             sub xs_load
20             {
21 1     1 1 43205 my($self, $package, $version, @rest) = @_;
22              
23             my $load = sub {
24 1     1   14 require XSLoader;
25 1         1001 XSLoader::load($package, $version);
26 1         18 };
27              
28 1 50       34 if($self->can('_xs_load_wrapper'))
29             {
30 0         0 $self->_xs_load_wrapper($load, @rest);
31             }
32             else
33             {
34 1         7 $load->();
35             }
36             }
37              
38              
39             sub rpath
40             {
41 4     4 1 1517 my($self, @other) = @_;
42            
43 4         12 my @dir;
44            
45 4         18 foreach my $alien ($self, @other)
46             {
47 4 50 33     64 if($alien->can('runtime_prop') && defined $alien->runtime_prop->{rpath})
48             {
49 4         70 require Path::Tiny;
50 4         15 foreach my $rpath (map { Path::Tiny->new($_)->absolute($alien->dist_dir)->stringify } @{ $alien->runtime_prop->{rpath} })
  4         49  
  4         18  
51             {
52 4         857 push @dir, $rpath;
53             }
54             }
55             }
56            
57 4         21 @dir;
58             }
59              
60              
61             require "Alien/Base/Dino/$^O.pm";
62              
63             1;
64              
65             __END__