File Coverage

lib/FFI/Build/PluginData.pm
Criterion Covered Total %
statement 15 15 100.0
branch 2 2 100.0
condition 2 2 100.0
subroutine 4 4 100.0
pod 0 1 0.0
total 23 24 95.8


line stmt bran cond sub pod time code
1             package FFI::Build::PluginData;
2              
3 16     16   233594 use strict;
  16         28  
  16         643  
4 16     16   77 use warnings;
  16         26  
  16         962  
5 16     16   725 use parent qw( Exporter );
  16         788  
  16         159  
6              
7             our @EXPORT_OK = qw( plugin_data );
8              
9             # ABSTRACT: Platform and local customizations of FFI::Build
10             our $VERSION = '2.11'; # VERSION
11              
12              
13             sub plugin_data
14             {
15 4     4 0 427559 my($self) = @_;
16 4         15 my $caller = caller;
17 4 100       30 if($caller =~ /^FFI::Build::Plugin::(.*)$/)
18             {
19 3   100     49 return $self->{plugin_data}->{$1} ||= {};
20             }
21             else
22             {
23 1         24 require Carp;
24 1         332 Carp::croak("plugin_data must be called by a plugin");
25             }
26             }
27              
28             1;
29              
30             __END__