File Coverage

blib/lib/Sub/HandlesVia/Toolkit/ObjectPad.pm.mite.pm
Criterion Covered Total %
statement 43 51 84.3
branch 3 8 37.5
condition 1 9 11.1
subroutine 10 10 100.0
pod 0 2 0.0
total 57 80 71.2


line stmt bran cond sub pod time code
1             {
2              
3             use strict;
4 1     1   7 use warnings;
  1         2  
  1         33  
5 1     1   5 no warnings qw( once void );
  1         2  
  1         30  
6 1     1   5  
  1         2  
  1         141  
7             our $USES_MITE = "Mite::Class";
8             our $MITE_SHIM = "Sub::HandlesVia::Mite";
9             our $MITE_VERSION = "0.010008";
10              
11             # Mite keywords
12             BEGIN {
13             my ( $SHIM, $CALLER ) =
14 1     1   5 ( "Sub::HandlesVia::Mite", "Sub::HandlesVia::Toolkit::ObjectPad" );
15             (
16             *after, *around, *before, *extends, *field,
17             *has, *param, *signature_for, *with
18             )
19             = do {
20 1         2  
21             no warnings 'redefine';
22             (
23 1     1   7 sub { $SHIM->HANDLE_after( $CALLER, "class", @_ ) },
  1         3  
  1         245  
24             sub { $SHIM->HANDLE_around( $CALLER, "class", @_ ) },
25 0         0 sub { $SHIM->HANDLE_before( $CALLER, "class", @_ ) },
26 1         8 sub { },
27 0         0 sub { $SHIM->HANDLE_has( $CALLER, field => @_ ) },
28             sub { $SHIM->HANDLE_has( $CALLER, has => @_ ) },
29 0         0 sub { $SHIM->HANDLE_has( $CALLER, param => @_ ) },
30 0         0 sub { $SHIM->HANDLE_signature_for( $CALLER, "class", @_ ) },
31 0         0 sub { $SHIM->HANDLE_with( $CALLER, @_ ) },
32 0         0 );
33 0         0 }
34 1         188  
35             # Mite imports
36             BEGIN {
37             require Scalar::Util;
38             *STRICT = \&Sub::HandlesVia::Mite::STRICT;
39             *bare = \&Sub::HandlesVia::Mite::bare;
40 1     1   8 *blessed = \&Scalar::Util::blessed;
41 1         3 *carp = \&Sub::HandlesVia::Mite::carp;
42 1         2 *confess = \&Sub::HandlesVia::Mite::confess;
43 1         3 *croak = \&Sub::HandlesVia::Mite::croak;
44 1         1 *false = \&Sub::HandlesVia::Mite::false;
45 1         3 *guard = \&Sub::HandlesVia::Mite::guard;
46 1         1 *lazy = \&Sub::HandlesVia::Mite::lazy;
47 1         2 *ro = \&Sub::HandlesVia::Mite::ro;
48 1         2 *rw = \&Sub::HandlesVia::Mite::rw;
49 1         2 *rwp = \&Sub::HandlesVia::Mite::rwp;
50 1         2 *true = \&Sub::HandlesVia::Mite::true;
51 1         3 }
52 1         2  
53 1         63 BEGIN {
54             require Sub::HandlesVia::Toolkit;
55              
56             use mro 'c3';
57 1     1   463 our @ISA;
58             push @ISA, "Sub::HandlesVia::Toolkit";
59 1     1   7 }
  1         2  
  1         16  
60 1         2  
61 1         234 # See UNIVERSAL
62             my ( $self, $role ) = @_;
63             our %DOES;
64             return $DOES{$role} if exists $DOES{$role};
65             return 1 if $role eq __PACKAGE__;
66 22     22 0 42 if ( $INC{'Moose/Util.pm'}
67 22         28 and my $meta = Moose::Util::find_meta( ref $self or $self ) )
68 22 50       46 {
69 22 50       40 $meta->can('does_role') and $meta->does_role($role) and return 1;
70 22 50 0     46 }
      33        
71             return $self->SUPER::DOES($role);
72             }
73 0 0 0     0  
74             # Alias for Moose/Moo-compatibility
75 22         55 shift->DOES(@_);
76             }
77              
78             1;