Chit.pm

filter: Statementstmt 85.7% 12 / 14 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 89.4% 17 / 19 CC 1 SCAR 0.6
CC
1
Cov
86%
BEGIN
1.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« Chit/Command/which.pm ↑ Summary
1 1 ▶use v5.20;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use experimental qw( signatures lexical_subs postderef );
Subroutine BEGIN: called CC=1 SCAR=0.0
5 0 ▶use utf8::all;
Subroutine BEGIN: called CC=1 SCAR=2.6
6  
7 package App::Chit;
8  
9 use App::Cmd::Setup -app;
10 use App::Chit::Util ();
11  
12 our $AUTHORITY = 'cpan:TOBYINK';
13 our $VERSION = '0.001001';
14  
15 sub default_command {
16 return "chat";
17 }
18  
19 sub run ( $self, @args ) {
20 $self->usage_error( "Set the @{[ App::Chit::Util::CHIT_KEY_VAR() ]} environment variable" )
21 unless $ENV{App::Chit::Util::CHIT_KEY_VAR()};
22 $self->SUPER::run( @args );
23 }
24  
25 sub _prepare_command ( $self, $command, $opt, @args ) {
26 if ( my $plugin = $self->plugin_for( $command ) ) {
27 return $plugin->prepare( $self, @args );
28 }
29 elsif ( length $command and App::Chit::Util::find_chit_dir() ) {
30 my $plugin = $self->plugin_for( $self->default_command );
31 return $plugin->prepare( $self, $command, @args );
32 }
33 else {
34 return $self->_bad_command( $command, $opt, @args );
35 }
36 }
37  
38 1;
39  
40 __END__
« Chit/Command/which.pm ↑ Summary