App/Plugin/Version/Command.pm

filter: Statementstmt 100% 29 / 29 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 1 totaltotal 97.3% 37 / 38 CC 3 SCAR 5.6
CC
3
Cov
100%
version
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.8
« App/Plugin/Version.pm ↑ Summary App/Message/Block.pm »
1 # ============================================================================
2 package MooseX::App::Plugin::Version::Command;
3 # ============================================================================
4  
5 4 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 4 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 4 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 4 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 4 ▶use MooseX::App::Command;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 4 command_short_description q(Print the current version);
13  
14 1 ▶sub version {
Subroutine version: called CC=3 SCAR=11.0
Pod undocumented
15 1 my ($self,$app) = @_;
16  
17 1 my $version = '';
18 1 $version .= $app->meta->app_base. ' version '.$app->VERSION."\n";
19 1 $version .= "MooseX::App version ".$MooseX::App::VERSION."\n";
20 1 $version .= "Perl version ".sprintf("%vd", $^V);
21  
22 1 my $message_class = $app->meta->app_messageclass;
23  
24 1 my @parts = ($message_class->new({
25 header => 'VERSION',
26 body => MooseX::App::Utils::format_text($version)
27 }));
28  
29 1 my %pod_raw = MooseX::App::Utils::parse_pod($app->meta->name);
30  
31 1 foreach my $part ('COPYRIGHT','LICENSE','COPYRIGHT AND LICENSE','AUTHOR','AUTHORS') {
32 5 ▶ if (defined $pod_raw{$part}) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $pod_raw{$part}) 1 4 5
33 push(@parts,$message_class->new({
34 header => $part,
35 1 body => MooseX::App::Utils::format_text($pod_raw{$part}),
36 }));
37 }
38 }
39  
40 1 return MooseX::App::Message::Envelope->new(@parts);
41 }
42  
43 4 __PACKAGE__->meta->make_immutable;
44 4 1;
« App/Plugin/Version.pm ↑ Summary App/Message/Block.pm »