File Coverage

blib/lib/Mite/App/Command/compile.pm
Criterion Covered Total %
statement 28 29 96.5
branch 3 4 75.0
condition n/a
subroutine 6 6 100.0
pod 0 2 0.0
total 37 41 90.2


line stmt bran cond sub pod time code
1 16     16   12347 use 5.010001;
  16         64  
2 16     16   99 use strict;
  16         52  
  16         506  
3 16     16   92 use warnings;
  16         43  
  16         819  
4              
5             use Mite::Miteception -all;
6 16     16   106 extends 'Mite::App::Command' => { -version => '0.009000' };
  16         40  
  16         133  
7              
8             our $AUTHORITY = 'cpan:TOBYINK';
9             our $VERSION = '0.011000';
10              
11             return "Make your code ready to run.";
12             }
13 16     16 0 71  
14             my $self = shift;
15              
16             require Mite::Attribute;
17 5     5 0 35 require Mite::Class;
18             require Mite::Config;
19 5         1847 require Mite::Project;
20 5         56 require Mite::Role;
21 5         26 require Mite::Role::Tiny;
22 5         26 require Mite::Signature;
23 5         1872  
24 5         1790 return 0 if $self->should_exit_quietly;
25 5         1649  
26             my $project = $self->project;
27 5 100       99  
28             # This is a hack to force Mite::* modules which are already loaded
29 3         330 # to be loaded again so Mite can compile itself.
30             #
31             if ( $self->config->data->{dogfood} ) {
32             $project->_module_fakeout_namespace(
33             sprintf 'A%02d::B%02d', int(rand 100), int(rand 100)
34 3 50       14 );
35 0         0 }
36              
37             $project->add_mite_shim;
38             $project->load_directory;
39             $project->write_mites;
40 2         21 $project->write_mopper;
41 2         31  
42 2         14 return 0;
43 2         14 }
44              
45 2         18 1;