File Coverage

blib/lib/Importer/Zim/Bogus.pm
Criterion Covered Total %
statement 15 31 48.3
branch 0 4 0.0
condition 0 3 0.0
subroutine 6 9 66.6
pod 0 1 0.0
total 21 48 43.7


line stmt bran cond sub pod time code
1              
2             package Importer::Zim::Bogus;
3             $Importer::Zim::Bogus::VERSION = '0.11.0';
4             # ABSTRACT: Bogus Importer::Zim backend
5              
6 1     1   1173 use 5.010001;
  1         3  
7              
8 1     1   5 use Importer::Zim::Base;
  1         2  
  1         31  
9 1     1   24 BEGIN { our @ISA = qw(Importer::Zim::Base); }
10              
11 1     1   5 use Importer::Zim::Utils qw(DEBUG carp);
  1         1  
  1         5  
12              
13             sub import {
14 0     0     my $class = shift;
15              
16 0           carp
17             qq{WARNING! Using bogus Importer::Zim backend (you may need to install a proper backend)};
18              
19 0           carp "$class->import(@_)" if DEBUG;
20 0           my @exports = $class->_prepare_args(@_);
21              
22 0           my $caller = caller;
23             return _export_to( #
24 0           map { ; "${caller}::$_->{export}" => $_->{code} } @exports
  0            
25             );
26             }
27              
28             sub export_to {
29 0     0 0   my $t = shift;
30 0 0 0       @_ = %{ $_[0] } if @_ == 1 && ref $_[0] eq 'HASH';
  0            
31 0 0         @_ = map { $_ & 1 ? $_[$_] : "${t}::$_[$_]" } 0 .. $#_;
  0            
32 0           goto &_export_to;
33             }
34              
35             sub _export_to {
36 0     0     my %imports = @_;
37              
38 1     1   6 no strict 'refs';
  1         3  
  1         64  
39 0           for ( keys %imports ) {
40 0           *$_ = $imports{$_};
41             }
42             }
43              
44 1     1   5 no Importer::Zim::Utils qw(DEBUG carp);
  1         2  
  1         5  
45              
46             1;
47              
48             #pod =encoding utf8
49             #pod
50             #pod =head1 SYNOPSIS
51             #pod
52             #pod use Importer::Zim::Bogus 'Scalar::Util' => 'blessed';
53             #pod use Importer::Zim::Bogus 'Scalar::Util' =>
54             #pod ( 'blessed' => { -as => 'typeof' } );
55             #pod
56             #pod use Importer::Zim::Bogus 'Mango::BSON' => ':bson';
57             #pod
58             #pod use Importer::Zim::Bogus 'Foo' => { -version => '3.0' } => 'foo';
59             #pod
60             #pod use Importer::Zim::Bogus 'Krazy::Taco' => qw(tacos burritos poop);
61             #pod
62             #pod =head1 DESCRIPTION
63             #pod
64             #pod "Is it supposed to be stupid?"
65             #pod – Zim
66             #pod
67             #pod This is a fallback backend for L.
68             #pod Only used when you have no installed legit backend.
69             #pod It does no cleaning at all – so it is a polluting module such
70             #pod as the regular L.
71             #pod
72             #pod The reason it exists is to provide a "working" L
73             #pod after installing L and its nominal dependencies.
74             #pod It will annoy you with warnings until a proper backend is installed.
75             #pod
76             #pod =head1 DEBUGGING
77             #pod
78             #pod You can set the C environment variable
79             #pod for get some diagnostics information printed to C.
80             #pod
81             #pod IMPORTER_ZIM_DEBUG=1
82             #pod
83             #pod =head1 SEE ALSO
84             #pod
85             #pod L
86             #pod
87             #pod =cut
88              
89             __END__