File Coverage

lib/Range/Merge/Boilerplate.pm
Criterion Covered Total %
statement 46 59 77.9
branch 4 8 50.0
condition n/a
subroutine 9 9 100.0
pod n/a
total 59 76 77.6


line stmt bran cond sub pod time code
1             #
2             # Copyright (C) 2015-2019 Joelle Maslak
3             # All Rights Reserved - See License
4             #
5              
6             package Range::Merge::Boilerplate;
7             # ABSTRACT: Generic Boilerplate (copied from JTM::Bootstrap)
8             $Range::Merge::Boilerplate::VERSION = '2.191190';
9              
10 6     6   1031398 use v5.22;
  6         48  
11 6     6   33 use strict;
  6         12  
  6         121  
12 6     6   31 use warnings;
  6         11  
  6         175  
13              
14 6     6   30 use feature 'signatures';
  6         11  
  6         987  
15 6     6   38 no warnings 'experimental::signatures';
  6         9  
  6         219  
16              
17 6     6   3238 use English;
  6         22166  
  6         33  
18 6     6   7209 use Import::Into;
  6         16069  
  6         200  
19 6     6   3296 use Smart::Comments;
  6         198259  
  6         41  
20              
21 12     12   89 sub import($self, $type='script') {
  12         33  
  12         28  
  12         19  
22 12 50       105 ### assert: ($type =~ m/^(?:class|role|script)$/ms)
  0         0  
  0         0  
  0         0  
  0         0  
23              
24 12         65 my $target = caller;
25              
26 12         81 strict->import::into($target);
27 12         2663 warnings->import::into($target);
28 12         2219 autodie->import::into($target);
29              
30 12         165772 feature->import::into($target, ':5.22');
31              
32 12         3652 utf8->import::into($target); # Allow UTF-8 Source
33              
34 12 50       3100 if ($type eq 'class') {
    50          
35 0         0 Moose->import::into($target);
36 0         0 Moose::Util::TypeConstraints->import::into($target);
37 0         0 MooseX::StrictConstructor->import::into($target);
38 0         0 namespace::autoclean->import::into($target);
39             } elsif ($type eq 'role') {
40 0         0 Moose::Role->import::into($target);
41 0         0 Moose::Util::TypeConstraints->import::into($target);
42 0         0 MooseX::StrictConstructor->import::into($target);
43 0         0 namespace::autoclean->import::into($target);
44             }
45              
46 12         65 Carp->import::into($target);
47 12         2482 English->import::into($target);
48 12         6412 Smart::Comments->import::into($target, '-ENV', '###');
49              
50 12         2946 feature->import::into($target, 'postderef'); # Not needed if feature budle >= 5.23.1
51              
52             # We haven't been using this
53             # feature->import::into($target, 'refaliasing');
54 12         2183 feature->import::into($target, 'signatures');
55              
56 12         2213 feature->import::into($target, 'switch');
57 12         2277 feature->import::into($target, 'unicode_strings');
58             # warnings->unimport::out_of($target, 'experimental::refaliasing');
59 12         2142 warnings->unimport::out_of($target, 'experimental::signatures');
60              
61 12 50       2569 if ($PERL_VERSION lt v5.24.0) {
62 0         0 warnings->unimport::out_of($target, 'experimental::postderef');
63             }
64              
65             # For "switch" feature
66 12         94 warnings->unimport::out_of($target, 'experimental::smartmatch');
67              
68 12         2173 return;
69             }
70              
71             1;
72              
73             __END__