blib/lib/Importer/Zim/Bogus.pm

filter: Statementstmt 51.5% 17 / 33 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 66.6% 6 / 9 Podpod 0.0% 0 / 1 totaltotal 44.2% 23 / 52 SCAR 22.8
CC
5
Cov
42%
export_to
20.0
_export_to
2.5
import
2.0
CRAP 9.8
« blib/lib/Importer/Zim/Utils.pm ↑ Summary Build »
1  
2 package Importer::Zim::Bogus;
3 1 $Importer::Zim::Bogus::VERSION = '0.11.0';
4 # ABSTRACT: Bogus Importer::Zim backend
5  
6 1 ▶use 5.010001;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 ▶use Importer::Zim::Base;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶BEGIN { our @ISA = qw(Importer::Zim::Base); }
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 1 ▶use Importer::Zim::Utils qw(DEBUG carp);
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 sub import {
14 0 ▶ my $class = shift;
Subroutine import: not called CC=1 SCAR=6.9
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
25 );
26 }
27  
28 sub export_to {
29 0 ▶ my $t = shift;
Subroutine export_to: not called CC=4 SCAR=30.0
Pod undocumented
30 0 ▶ @_ = %{ $_[0] } if @_ == 1 && ref $_[0] eq 'HASH';
Branch: 1 branch
BranchTrueFalseTotal
if @_ == 1 and ref $_[0] eq "HASH" 0 0 0
Condition0%0/3
@_ == 1 and ref $_[0] eq "HASH"
!ll&&!rl&&r
000
MC/DC0%0/2
@_ == 1 and ref $_[0] eq "HASH"
@_ == 1 ref $_[0] eq "HASH"
Truth table0%0/3
A and B
A= @_ == 1B= ref $_[0] eq "HASH"
ABresult
0X0
100
111
31 0 ▶ @_ = map { $_ & 1 ? $_[$_] : "${t}::$_[$_]" } 0 .. $#_;
Branch: 1 branch
BranchTrueFalseTotal
$_ & 1 ? : 0 0 0
32 0 goto &_export_to;
33 }
34  
35 sub _export_to {
36 0 ▶ my %imports = @_;
Subroutine _export_to: not called CC=2 SCAR=9.2
37  
38 1 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
39 0 for ( keys %imports ) {
40 0 *$_ = $imports{$_};
41 }
42 }
43  
44 1 ▶no Importer::Zim::Utils qw(DEBUG carp);
Subroutine BEGIN: called CC=1 SCAR=0.0
45  
46 1 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<Importer::Zim>.
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<Exporter>.
71 #pod
72 #pod The reason it exists is to provide a "working" L<Importer::Zim>
73 #pod after installing L<Importer::Zim> 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<IMPORTER_ZIM_DEBUG> environment variable
79 #pod for get some diagnostics information printed to C<STDERR>.
80 #pod
81 #pod IMPORTER_ZIM_DEBUG=1
82 #pod
83 #pod =head1 SEE ALSO
84 #pod
85 #pod L<Importer::Zim>
86 #pod
87 #pod =cut
88  
89 __END__
« blib/lib/Importer/Zim/Utils.pm ↑ Summary Build »