File Coverage

blib/lib/App/Chit.pm
Criterion Covered Total %
statement 20 39 51.2
branch 0 6 0.0
condition 0 3 0.0
subroutine 7 10 70.0
pod 2 2 100.0
total 29 60 48.3


line stmt bran cond sub pod time code
1 1     1   246950 use v5.20;
  1         4  
2 1     1   5 use strict;
  1         11  
  1         68  
3 1     1   5 use warnings;
  1         2  
  1         57  
4 1     1   572 use experimental qw( signatures lexical_subs postderef );
  1         5264  
  1         7  
5 1     1   903 use utf8::all;
  1         48957  
  1         7  
6              
7             package App::Chit;
8              
9 1     1   40883 use App::Cmd::Setup -app;
  1         57163  
  1         15  
10 1     1   1910 use App::Chit::Util ();
  1         7  
  1         687  
11              
12             our $AUTHORITY = 'cpan:TOBYINK';
13             our $VERSION = '0.001001';
14              
15             sub default_command {
16 0     0 1   return "chat";
17             }
18              
19 0     0 1   sub run ( $self, @args ) {
  0            
  0            
  0            
20 0           $self->usage_error( "Set the @{[ App::Chit::Util::CHIT_KEY_VAR() ]} environment variable" )
21 0 0         unless $ENV{App::Chit::Util::CHIT_KEY_VAR()};
22 0           $self->SUPER::run( @args );
23             }
24              
25 0     0     sub _prepare_command ( $self, $command, $opt, @args ) {
  0            
  0            
  0            
  0            
  0            
26 0 0 0       if ( my $plugin = $self->plugin_for( $command ) ) {
    0          
27 0           return $plugin->prepare( $self, @args );
28             }
29             elsif ( length $command and App::Chit::Util::find_chit_dir() ) {
30 0           my $plugin = $self->plugin_for( $self->default_command );
31 0           return $plugin->prepare( $self, $command, @args );
32             }
33             else {
34 0           return $self->_bad_command( $command, $opt, @args );
35             }
36             }
37              
38             1;
39              
40             __END__