File Coverage

blib/lib/Exporter/Shiny.pm
Criterion Covered Total %
statement 29 29 100.0
branch 5 6 83.3
condition 5 8 62.5
subroutine 6 6 100.0
pod n/a
total 45 49 91.8


line stmt bran cond sub pod time code
1             package Exporter::Shiny;
2              
3 13     13   1480451 use 5.006001;
  13         85  
4 13     13   121 use strict;
  13         41  
  13         506  
5 13     13   73 use warnings;
  13         38  
  13         898  
6              
7 13     13   7533 use Exporter::Tiny ();
  13         45  
  13         3586  
8              
9             our $AUTHORITY = 'cpan:TOBYINK';
10             our $VERSION = '1.006003';
11              
12             sub import {
13 15     15   253196 my $me = shift;
14 15         47 my $caller = caller;
15            
16 15         86 (my $nominal_file = $caller) =~ s(::)(/)g;
17 15   50     153 $INC{"$nominal_file\.pm"} ||= __FILE__;
18            
19 15 100 100     83 if (@_ == 2 and $_[0] eq -setup)
20             {
21 2         6 my (undef, $opts) = @_;
22 2 50       4 @_ = @{ delete($opts->{exports}) || [] };
  2         12  
23            
24 2 100       9 if (%$opts) {
25 1         12 Exporter::Tiny::_croak(
26             'Unsupported Sub::Exporter-style options: %s',
27             join(q[, ], sort keys %$opts),
28             );
29             }
30             }
31            
32 14   33     79 ref($_) && Exporter::Tiny::_croak('Expected sub name, got ref %s', $_) for @_;
33            
34 13     13   119 no strict qw(refs);
  13         29  
  13         1875  
35 14         36 push @{"$caller\::ISA"}, 'Exporter::Tiny';
  14         222  
36 14         32 push @{"$caller\::EXPORT_OK"}, @_;
  14         7487  
37             }
38              
39             1;
40              
41             __END__