File Coverage

blib/lib/Mite/Role/Tiny.pm.mite.pm
Criterion Covered Total %
statement 37 53 69.8
branch 0 8 0.0
condition 0 9 0.0
subroutine 9 19 47.3
pod 0 2 0.0
total 46 91 50.5


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