line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ============================================================================ |
2
|
|
|
|
|
|
|
package MooseX::App::Plugin::Version::Command; |
3
|
|
|
|
|
|
|
# ============================================================================ |
4
|
|
|
|
|
|
|
|
5
|
4
|
|
|
4
|
|
1380
|
use 5.010; |
|
4
|
|
|
|
|
18
|
|
6
|
4
|
|
|
4
|
|
25
|
use utf8; |
|
4
|
|
|
|
|
12
|
|
|
4
|
|
|
|
|
24
|
|
7
|
|
|
|
|
|
|
|
8
|
4
|
|
|
4
|
|
100
|
use namespace::autoclean; |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
24
|
|
9
|
4
|
|
|
4
|
|
319
|
use Moose; |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
27
|
|
10
|
4
|
|
|
4
|
|
30839
|
use MooseX::App::Command; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
35
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
command_short_description q(Print the current version); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub version { |
15
|
1
|
|
|
1
|
0
|
3
|
my ($self,$app) = @_; |
16
|
|
|
|
|
|
|
|
17
|
1
|
|
|
|
|
2
|
my $version = ''; |
18
|
1
|
|
|
|
|
4
|
$version .= $app->meta->app_base. ' version '.$app->VERSION."\n"; |
19
|
1
|
|
|
|
|
6
|
$version .= "MooseX::App version ".$MooseX::App::VERSION."\n"; |
20
|
1
|
|
|
|
|
13
|
$version .= "Perl version ".sprintf("%vd", $^V); |
21
|
|
|
|
|
|
|
|
22
|
1
|
|
|
|
|
5
|
my $message_class = $app->meta->app_messageclass; |
23
|
|
|
|
|
|
|
|
24
|
1
|
|
|
|
|
7
|
my @parts = ($message_class->new({ |
25
|
|
|
|
|
|
|
header => 'VERSION', |
26
|
|
|
|
|
|
|
body => MooseX::App::Utils::format_text($version) |
27
|
|
|
|
|
|
|
})); |
28
|
|
|
|
|
|
|
|
29
|
1
|
|
|
|
|
6
|
my %pod_raw = MooseX::App::Utils::parse_pod($app->meta->name); |
30
|
|
|
|
|
|
|
|
31
|
1
|
|
|
|
|
225
|
foreach my $part ('COPYRIGHT','LICENSE','COPYRIGHT AND LICENSE','AUTHOR','AUTHORS') { |
32
|
5
|
100
|
|
|
|
16
|
if (defined $pod_raw{$part}) { |
33
|
|
|
|
|
|
|
push(@parts,$message_class->new({ |
34
|
|
|
|
|
|
|
header => $part, |
35
|
1
|
|
|
|
|
8
|
body => MooseX::App::Utils::format_text($pod_raw{$part}), |
36
|
|
|
|
|
|
|
})); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
1
|
|
|
|
|
38
|
return MooseX::App::Message::Envelope->new(@parts); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
44
|
|
|
|
|
|
|
1; |