File Coverage

blib/lib/Acme/ChuckNorris.pm
Criterion Covered Total %
statement 19 19 100.0
branch 2 8 25.0
condition n/a
subroutine 6 6 100.0
pod 2 2 100.0
total 29 35 82.8


line stmt bran cond sub pod time code
1             package Acme::ChuckNorris;
2              
3 1     1   24537 use strict;
  1         2  
  1         40  
4 1     1   5 use warnings;
  1         2  
  1         51  
5              
6             $Acme::ChuckNorris::VERSION = '0.3';
7              
8             sub import {
9 1     1   5 no strict 'refs'; ## no critic
  1         7  
  1         339  
10 1     1   8 *{ caller() . '::round_house_kick_to_the_perl' } = \&round_house_kick_to_the_perl;
  1         11  
11 1         2 *{ caller() . '::round_house_kick_to_the_text' } = \&round_house_kick_to_the_text;
  1         14  
12             }
13              
14             my %mostly_defaults = (
15             'Regex' => 1,
16             'Binary' => 0,
17             );
18              
19             my %defaults_overridable = (
20             'Gap' => 1,
21             'InformHandler' => sub { },
22             'TrailingSpaces' => 1,
23             );
24              
25             sub round_house_kick_to_the_text {
26 1     1 1 764 require Acme::EyeDrops;
27 1         22 return Acme::EyeDrops::sightly(
28             {
29             %defaults_overridable, # allow caller to override these in @_
30             @_[ 1 .. $#_ ],
31 1 0       11 ( ref( $_[0] ) eq 'SCALAR' ? ( 'SourceString' => ${ $_[0] } ) : ref( $_[0] ) ? ( 'SourceHandle' => $_[0] ) : ( 'SourceFile' => $_[0] ) ),
    50          
32             'ShapeString' => join( '', ),
33             'Shape' => undef,
34             %mostly_defaults, # not overridable
35             'Print' => 1,
36             }
37             );
38             }
39              
40             sub round_house_kick_to_the_perl {
41 2     2 1 5227 require Acme::EyeDrops;
42 2         199 return Acme::EyeDrops::sightly(
43             {
44              
45             # allow caller to override the below options in @_
46             %defaults_overridable,
47             %mostly_defaults, # overridable
48             'TrapEvalDie' => 1,
49             'TrapWarn' => 1,
50              
51             # allow caller to override the above options in @_
52             @_[ 1 .. $#_ ],
53 2 0       8436 ( ref( $_[0] ) eq 'SCALAR' ? ( 'SourceString' => ${ $_[0] } ) : ref( $_[0] ) ? ( 'SourceHandle' => $_[0] ) : ( 'SourceFile' => $_[0] ) ),
    50          
54             'ShapeString' => join( '', ),
55             'Shape' => undef,
56             }
57             );
58             }
59              
60             'When Chuck Norris is SCUBA diving and surfaces too fast the ocean gets the bends.'; # return true, so very very true
61              
62             __DATA__