line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
16
|
|
|
16
|
|
363
|
use 5.010001; |
|
16
|
|
|
|
|
65
|
|
2
|
16
|
|
|
16
|
|
136
|
use strict; |
|
16
|
|
|
|
|
38
|
|
|
16
|
|
|
|
|
516
|
|
3
|
16
|
|
|
16
|
|
113
|
use warnings; |
|
16
|
|
|
|
|
57
|
|
|
16
|
|
|
|
|
717
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Mite::App::Command; |
6
|
16
|
|
|
16
|
|
102
|
use Mite::Miteception -all; |
|
16
|
|
|
|
|
63
|
|
|
16
|
|
|
|
|
202
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:TOBYINK'; |
9
|
|
|
|
|
|
|
our $VERSION = '0.012000'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
has app => ( |
12
|
|
|
|
|
|
|
is => ro, |
13
|
|
|
|
|
|
|
isa => Object, |
14
|
|
|
|
|
|
|
required => true, |
15
|
|
|
|
|
|
|
weak_ref => true, |
16
|
|
|
|
|
|
|
handles => [ 'config', 'project', 'kingpin' ], |
17
|
|
|
|
|
|
|
); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
has kingpin_command => ( |
20
|
|
|
|
|
|
|
is => lazy, |
21
|
|
|
|
|
|
|
isa => Object, |
22
|
|
|
|
|
|
|
); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub command_name { |
25
|
160
|
|
|
160
|
0
|
267
|
my $self = shift; |
26
|
160
|
|
33
|
|
|
398
|
my $class = ref($self) || $self; |
27
|
|
|
|
|
|
|
|
28
|
160
|
|
|
|
|
917
|
my ( $part ) = ( $class =~ /::(\w+)$/ ); |
29
|
|
|
|
|
|
|
|
30
|
160
|
|
|
|
|
710
|
return $part; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub abstract { |
34
|
0
|
|
|
0
|
0
|
0
|
return '???'; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub BUILD { |
38
|
80
|
|
|
80
|
0
|
186
|
my ( $self, $app ) = @_; |
39
|
|
|
|
|
|
|
|
40
|
80
|
|
|
|
|
377
|
my $name = $self->command_name; |
41
|
80
|
|
|
|
|
864
|
$self->app->commands->{$name} = $self; |
42
|
|
|
|
|
|
|
|
43
|
80
|
|
|
|
|
545
|
$self->kingpin_command; # force build |
44
|
|
|
|
|
|
|
|
45
|
80
|
|
|
|
|
297
|
return; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub _build_kingpin_command { |
49
|
80
|
|
|
80
|
|
170
|
my ( $self ) = @_; |
50
|
|
|
|
|
|
|
|
51
|
80
|
|
|
|
|
371
|
return $self->kingpin->command( $self->command_name, $self->abstract ); |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub should_exit_quietly { |
55
|
6
|
|
|
6
|
0
|
17
|
my $self = shift; |
56
|
|
|
|
|
|
|
|
57
|
6
|
|
|
|
|
56
|
my $config = $self->config; |
58
|
|
|
|
|
|
|
|
59
|
6
|
100
|
|
|
|
57
|
return false |
60
|
|
|
|
|
|
|
unless $self->app->get_flag_value( 'exit-if-no-mite-dir' ); |
61
|
|
|
|
|
|
|
|
62
|
2
|
50
|
66
|
|
|
203
|
return true |
63
|
|
|
|
|
|
|
if !$self->app->get_flag_value( 'search-mite-dir' ) |
64
|
|
|
|
|
|
|
&& !$config->dir_has_mite("."); |
65
|
|
|
|
|
|
|
|
66
|
1
|
50
|
|
|
|
89
|
return true |
67
|
|
|
|
|
|
|
if !$config->find_mite_dir; |
68
|
|
|
|
|
|
|
|
69
|
0
|
|
|
|
|
|
return false; |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
1; |