File Coverage

blib/lib/Range/Merge/Boilerplate.pm
Criterion Covered Total %
statement 42 55 76.3
branch 4 8 50.0
condition n/a
subroutine 8 8 100.0
pod n/a
total 54 71 76.0


line stmt bran cond sub pod time code
1             #
2             # Copyright (C) 2015,2016 J. Maslak
3             # All Rights Reserved - See License
4             #
5              
6             package Range::Merge::Boilerplate v0.01.11;
7             # ABSTRACT: Generic Boilerplate (copied from JCM::Bootstrap)
8             $Range::Merge::Boilerplate::VERSION = '1.003';
9              
10 4     4   389215 use v5.22;
  4         13  
11 4     4   17 use strict;
  4         7  
  4         77  
12              
13 4     4   16 use feature 'signatures';
  4         8  
  4         387  
14 4     4   21 no warnings 'experimental::signatures';
  4         6  
  4         133  
15              
16 4     4   1128 use English;
  4         9615  
  4         21  
17 4     4   2409 use Import::Into;
  4         7623  
  4         97  
18 4     4   1235 use Smart::Comments;
  4         98200  
  4         24  
19              
20 8     8   46 sub import($self, $type='script') {
  8         21  
  8         19  
  8         10  
21 8 50       66 ### assert: ($type =~ m/^(?:class|role|script)$/ms)
  0         0  
  0         0  
  0         0  
  0         0  
22            
23 8         21 my $target = caller;
24              
25 8         54 strict->import::into($target);
26 8         1535 warnings->import::into($target);
27 8         1252 autodie->import::into($target);
28              
29 8         89913 feature->import::into($target, ':5.22');
30              
31 8         2185 utf8->import::into($target); # Allow UTF-8 Source
32              
33 8 50       1683 if ($type eq 'class') {
    50          
34 0         0 Moose->import::into($target);
35 0         0 Moose::Util::TypeConstraints->import::into($target);
36 0         0 MooseX::StrictConstructor->import::into($target);
37 0         0 namespace::autoclean->import::into($target);
38             } elsif ($type eq 'role') {
39 0         0 Moose::Role->import::into($target);
40 0         0 Moose::Util::TypeConstraints->import::into($target);
41 0         0 MooseX::StrictConstructor->import::into($target);
42 0         0 namespace::autoclean->import::into($target);
43             }
44              
45 8         52 Carp->import::into($target);
46 8         1483 English->import::into($target);
47 8         3710 Smart::Comments->import::into($target, '-ENV', '###');
48              
49 8         1690 feature->import::into($target, 'postderef'); # Not needed if feature budle >= 5.23.1
50              
51             # We haven't been using this
52             # feature->import::into($target, 'refaliasing');
53 8         1234 feature->import::into($target, 'signatures');
54              
55 8         1217 feature->import::into($target, 'switch');
56 8         1220 feature->import::into($target, 'unicode_strings');
57             # warnings->unimport::out_of($target, 'experimental::refaliasing');
58 8         1232 warnings->unimport::out_of($target, 'experimental::signatures');
59              
60 8 50       1558 if ($PERL_VERSION lt v5.24.0) {
61 0         0 warnings->unimport::out_of($target, 'experimental::postderef');
62             }
63              
64             # For "switch" feature
65 8         52 warnings->unimport::out_of($target, 'experimental::smartmatch');
66             }
67              
68             1;
69              
70             __END__