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