line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
106
|
|
|
106
|
|
15341
|
use 5.010001; |
|
106
|
|
|
|
|
359
|
|
2
|
106
|
|
|
106
|
|
563
|
use strict; |
|
106
|
|
|
|
|
254
|
|
|
106
|
|
|
|
|
2538
|
|
3
|
106
|
|
|
106
|
|
519
|
use warnings; |
|
106
|
|
|
|
|
242
|
|
|
106
|
|
|
|
|
4595
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
use Mite::Miteception -all; |
6
|
106
|
|
|
106
|
|
654
|
|
|
106
|
|
|
|
|
208
|
|
|
106
|
|
|
|
|
802
|
|
7
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:TOBYINK'; |
8
|
|
|
|
|
|
|
our $VERSION = '0.010008'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
use Path::Tiny; |
11
|
106
|
|
|
106
|
|
673
|
|
|
106
|
|
|
|
|
210
|
|
|
106
|
|
|
|
|
64912
|
|
12
|
|
|
|
|
|
|
# Don't load Mite::Source else it will go circular |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
has file => |
15
|
|
|
|
|
|
|
is => rw, |
16
|
|
|
|
|
|
|
isa => Path, |
17
|
|
|
|
|
|
|
coerce => true, |
18
|
|
|
|
|
|
|
lazy => true, |
19
|
|
|
|
|
|
|
default => sub { |
20
|
|
|
|
|
|
|
my $self = shift; |
21
|
|
|
|
|
|
|
return $self->_source_file2compiled_file( $self->source->file ); |
22
|
|
|
|
|
|
|
}; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
has source => |
25
|
|
|
|
|
|
|
is => ro, |
26
|
|
|
|
|
|
|
isa => MiteSource, |
27
|
|
|
|
|
|
|
# avoid a circular dep with Mite::Source |
28
|
|
|
|
|
|
|
weak_ref => true, |
29
|
|
|
|
|
|
|
required => true, |
30
|
|
|
|
|
|
|
handles => [ qw( classes class_order ) ]; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
my $self = shift; |
33
|
|
|
|
|
|
|
|
34
|
96
|
|
|
96
|
0
|
236
|
my $code; |
35
|
|
|
|
|
|
|
for my $class_name ( @{ $self->class_order } ) { |
36
|
96
|
|
|
|
|
180
|
my $class = $self->classes->{$class_name}; |
37
|
96
|
|
|
|
|
188
|
|
|
96
|
|
|
|
|
467
|
|
38
|
130
|
|
|
|
|
569
|
# Only supported by Type::Tiny 1.013_001 but no harm |
39
|
|
|
|
|
|
|
# in doing this anyway. |
40
|
|
|
|
|
|
|
local $Type::Tiny::SafePackage = sprintf 'package %s;', |
41
|
|
|
|
|
|
|
eval { $self->source->project->config->data->{shim} } |
42
|
|
|
|
|
|
|
// do { $class_name . '::__SAFE_NAMESPACE__' }; |
43
|
130
|
|
|
|
|
687
|
|
44
|
130
|
|
66
|
|
|
302
|
$code .= $class->compile; |
|
124
|
|
|
|
|
4387
|
|
45
|
|
|
|
|
|
|
} |
46
|
130
|
|
|
|
|
1198
|
|
47
|
|
|
|
|
|
|
my $tidied; |
48
|
|
|
|
|
|
|
eval { |
49
|
96
|
|
|
|
|
303
|
my $flag; |
50
|
96
|
50
|
66
|
|
|
226
|
if ( $self->source->project->config->should_tidy ) { |
|
|
|
33
|
|
|
|
|
51
|
96
|
|
|
|
|
161
|
$flag = Perl::Tidy::perltidy( |
52
|
96
|
50
|
|
|
|
591
|
source => \$code, |
53
|
0
|
|
|
|
|
0
|
destination => \$tidied, |
54
|
|
|
|
|
|
|
argv => [], |
55
|
|
|
|
|
|
|
); |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
!$flag; |
58
|
|
|
|
|
|
|
} and defined($tidied) and length($tidied) and ($code = $tidied); |
59
|
6
|
|
|
|
|
53
|
|
60
|
|
|
|
|
|
|
return $code; |
61
|
|
|
|
|
|
|
} |
62
|
96
|
|
|
|
|
2578
|
|
63
|
|
|
|
|
|
|
my ( $self, %opts ) = @_; |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
my $code = $self->compile; |
66
|
96
|
|
|
96
|
0
|
449
|
if ( defined $opts{module_fakeout_namespace} ) { |
67
|
|
|
|
|
|
|
my $ns = $opts{module_fakeout_namespace}; |
68
|
96
|
|
|
|
|
416
|
$code =~ s/$ns\:://g; |
69
|
96
|
50
|
|
|
|
418
|
} |
70
|
0
|
|
|
|
|
0
|
|
71
|
0
|
|
|
|
|
0
|
return $self->file->spew_utf8($code); |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
96
|
|
|
|
|
530
|
my $self = shift; |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
return $self->file->remove; |
77
|
|
|
|
|
|
|
} |
78
|
1
|
|
|
1
|
0
|
5
|
|
79
|
|
|
|
|
|
|
signature_for _source_file2compiled_file => ( |
80
|
1
|
|
|
|
|
3
|
pos => [ Defined ], |
81
|
|
|
|
|
|
|
); |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
my ( $self, $source_file ) = @_; |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
# Changes here must be coordinated with Mite.pm |
86
|
|
|
|
|
|
|
return $source_file . '.mite.pm'; |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
1; |