lib/Mite/App/Command/preview.pm

filter: Statementstmt 70.0% 21 / 30 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 85.7% 6 / 7 Podpod 0.0% 0 / 2 totaltotal 62.7% 27 / 43 CC 3 SCAR 15.4
CC
3
Cov
62%
execute
12.0
BEGIN
1.0
BEGIN
1.0
CRAP 4.7
« lib/Mite/Trait/HasAttributes.pm ↑ Summary lib/Mite/Shim.pm »
1 24 ▶use 5.010001;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 24 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 24 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 package Mite::App::Command::preview;
6 24 ▶use Mite::Miteception -all;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 24 extends qw(Mite::App::Command);
8  
9 24 our $AUTHORITY = 'cpan:TOBYINK';
10 24 our $VERSION = '0.013000';
11  
12 24 ▶sub abstract {
Subroutine abstract: called CC=1 SCAR=0.0
Pod undocumented
13 24 return "Preview the .mite.pm for a file.";
14 }
15  
16 24 ▶around _build_kingpin_command => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
17 24 my ( $next, $self, @args ) = @_;
18  
19 24 my $command = $self->$next( @args );
20 24 $command->arg( 'file', 'Path to file to preview.' )->required->existing_file;
21  
22 24 return $command;
23 24 };
24  
25 0 ▶sub execute {
Subroutine execute: not called CC=3 SCAR=24.8
Pod undocumented
26 0 my $self = shift;
27  
28 0 ▶ return 0 if $self->should_exit_quietly;
Branch: 1 branch
BranchTrueFalseTotal
if $self->should_exit_quietly 0 0 0
29  
30 0 my $file = $self->kingpin_command->args->get( 'file' )->value;
31  
32 0 my $project = $self->project;
33 0 $project->load_directory;
34  
35 $project->load_files( [ $file ], '.' )
36 0 ▶ unless $project->sources->{$file};
Branch: 1 branch
BranchTrueFalseTotal
unless $project->sources->{$file} 0 0 0
37  
38 0 my $source = $project->source_for( $file );
39 0 print $source->compile;
40  
41 0 return 0;
42 }
43  
44 24 1;
« lib/Mite/Trait/HasAttributes.pm ↑ Summary lib/Mite/Shim.pm »