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 12     12   683955 use 5.006001;
  12         135  
4 12     12   64 use strict;
  12         24  
  12         265  
5 12     12   54 use warnings;
  12         47  
  12         372  
6              
7 12     12   4965 use Exporter::Tiny ();
  12         33  
  12         2347  
8              
9             our $AUTHORITY = 'cpan:TOBYINK';
10             our $VERSION = '1.006001';
11              
12             sub import {
13 14     14   1720 my $me = shift;
14 14         39 my $caller = caller;
15            
16 14         70 (my $nominal_file = $caller) =~ s(::)(/)g;
17 14   50     157 $INC{"$nominal_file\.pm"} ||= __FILE__;
18            
19 14 100 100     67 if (@_ == 2 and $_[0] eq -setup)
20             {
21 2         6 my (undef, $opts) = @_;
22 2 50       3 @_ = @{ delete($opts->{exports}) || [] };
  2         9  
23            
24 2 100       8 if (%$opts) {
25 1         8 Exporter::Tiny::_croak(
26             'Unsupported Sub::Exporter-style options: %s',
27             join(q[, ], sort keys %$opts),
28             );
29             }
30             }
31            
32 13   33     63 ref($_) && Exporter::Tiny::_croak('Expected sub name, got ref %s', $_) for @_;
33            
34 12     12   94 no strict qw(refs);
  12         24  
  12         1114  
35 13         22 push @{"$caller\::ISA"}, 'Exporter::Tiny';
  13         157  
36 13         27 push @{"$caller\::EXPORT_OK"}, @_;
  13         5448  
37             }
38              
39             1;
40              
41             __END__