File Coverage

blib/lib/Reindeer/Role.pm
Criterion Covered Total %
statement 31 31 100.0
branch 2 4 50.0
condition n/a
subroutine 7 7 100.0
pod 0 1 0.0
total 40 43 93.0


line stmt bran cond sub pod time code
1             #
2             # This file is part of Reindeer
3             #
4             # This software is Copyright (c) 2017, 2015, 2014, 2012, 2011 by Chris Weyl.
5             #
6             # This is free software, licensed under:
7             #
8             # The GNU Lesser General Public License, Version 2.1, February 1999
9             #
10             package Reindeer::Role;
11             our $AUTHORITY = 'cpan:RSRCHBOY';
12             $Reindeer::Role::VERSION = '0.019';
13             # ABSTRACT: Reindeer in role form
14              
15 7     7   2756475 use strict;
  7         16  
  7         323  
16 7     7   39 use warnings;
  7         13  
  7         307  
17              
18 7     7   39 use Reindeer::Util;
  7         14  
  7         208  
19 7     7   1174 use Moose::Exporter;
  7         14  
  7         183  
20 7     7   190 use Import::Into;
  7         13  
  7         1315  
21              
22             my (undef, undef, $init_meta) = Moose::Exporter->build_import_methods(
23             install => [ qw{ import unimport } ],
24              
25             also => [ 'Moose::Role', Reindeer::Util::also_list() ],
26             trait_aliases => [ Reindeer::Util::trait_aliases() ],
27             as_is => [ Reindeer::Util::as_is() ],
28             );
29              
30             sub init_meta {
31 12     12 0 210940 my ($class, %options) = @_;
32 12         31 my $for_class = $options{for_class};
33              
34 12 50       70 if ($] >= 5.010) {
35              
36 7     7   48 eval 'use feature';
  7         15  
  7         1290  
  12         635  
37 12         790 feature->import(':5.10');
38             }
39              
40             ### $for_class
41 12         80 Moose::Role->init_meta(for_class => $for_class);
42 12         32654 Reindeer::Util->import_type_libraries({ -into => $for_class });
43 12         768 Path::Class->export_to_level(1);
44 12         103 Try::Tiny->import::into(1);
45 12         2370 MooseX::Params::Validate->import({ into => $for_class });
46 12         4784 Moose::Util::TypeConstraints->import(
47             { into => $for_class },
48             qw{ class_type role_type duck_type },
49             );
50 12         7247 MooseX::MarkAsMethods->import({ into => $for_class }, autoclean => 1);
51              
52 12 50       87589 goto $init_meta if defined $init_meta;
53             }
54              
55             !!42;
56              
57             __END__
58              
59             =pod
60              
61             =encoding UTF-8
62              
63             =for :stopwords Chris Weyl Alex Balhatchet
64              
65             =head1 NAME
66              
67             Reindeer::Role - Reindeer in role form
68              
69             =head1 VERSION
70              
71             This document describes version 0.019 of Reindeer::Role - released June 09, 2017 as part of Reindeer.
72              
73             =head1 SYNOPSIS
74              
75             # ta-da!
76             use Reindeer::Role;
77              
78             =head1 DESCRIPTION
79              
80             For now, see the L<Reindeer> docs for information about what meta extensions
81             are automatically applied.
82              
83             =for Pod::Coverage init_meta
84              
85             =head1 SEE ALSO
86              
87             Please see those modules/websites for more information related to this module.
88              
89             =over 4
90              
91             =item *
92              
93             L<Reindeer|Reindeer>
94              
95             =item *
96              
97             L<Moose::Role>
98              
99             =back
100              
101             =head1 BUGS
102              
103             Please report any bugs or feature requests on the bugtracker website
104             L<https://github.com/RsrchBoy/reindeer/issues>
105              
106             When submitting a bug or request, please include a test-file or a
107             patch to an existing test-file that illustrates the bug or desired
108             feature.
109              
110             =head1 AUTHOR
111              
112             Chris Weyl <cweyl@alumni.drew.edu>
113              
114             =head1 COPYRIGHT AND LICENSE
115              
116             This software is Copyright (c) 2017, 2015, 2014, 2012, 2011 by Chris Weyl.
117              
118             This is free software, licensed under:
119              
120             The GNU Lesser General Public License, Version 2.1, February 1999
121              
122             =cut