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   11500 use 5.010001;
  16         54  
2 16     16   85 use strict;
  16         28  
  16         465  
3 16     16   79 use warnings;
  16         33  
  16         741  
4              
5             use Mite::Miteception -all;
6 16     16   96 extends 'Mite::App::Command' => { -version => '0.009000' };
  16         36  
  16         136  
7              
8             our $AUTHORITY = 'cpan:TOBYINK';
9             our $VERSION = '0.010008';
10              
11             return "Make your code ready to run.";
12             }
13 16     16 0 78  
14             my $self = shift;
15              
16             require Mite::Attribute;
17 5     5 0 15 require Mite::Class;
18             require Mite::Config;
19 5         1987 require Mite::Project;
20 5         55 require Mite::Role;
21 5         21 require Mite::Role::Tiny;
22 5         25 require Mite::Signature;
23 5         1868  
24 5         2068 return 0 if $self->should_exit_quietly;
25 5         1566  
26             my $project = $self->project;
27 5 100       94  
28             # This is a hack to force Mite::* modules which are already loaded
29 3         244 # 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       9 );
35 0         0 }
36              
37             $project->add_mite_shim;
38             $project->load_directory;
39             $project->write_mites;
40 2         31 $project->write_mopper;
41 2         23  
42 2         12 return 0;
43 2         14 }
44              
45 2         21 1;