File Coverage

blib/lib/App/JobLog/Command/done.pm
Criterion Covered Total %
statement 9 18 50.0
branch 0 2 0.0
condition 0 3 0.0
subroutine 3 6 50.0
pod 3 3 100.0
total 15 32 46.8


line stmt bran cond sub pod time code
1             package App::JobLog::Command::done;
2             $App::JobLog::Command::done::VERSION = '1.041';
3             # ABSTRACT: close last open event
4              
5 2     2   1642 use App::JobLog -command;
  2         5  
  2         15  
6 2     2   754 use Modern::Perl;
  2         4  
  2         12  
7 2     2   223 use Class::Autouse 'App::JobLog::Log';
  2         4  
  2         12  
8              
9             sub execute {
10 0     0 1   my ( $self, $opt, $args ) = @_;
11 0           $self->simple_command_check($args);
12              
13 0           my $log = App::JobLog::Log->new;
14 0           my ($last) = $log->last_event;
15 0 0 0       if ( $last && $last->is_open ) {
16 0           $log->append_event( done => 1 );
17             }
18             else {
19 0           say 'No currently open event in log.';
20             }
21             }
22              
23 0     0 1   sub usage_desc { '%c ' . __PACKAGE__->name }
24              
25 0     0 1   sub abstract { 'mark current task as done' }
26              
27             1;
28              
29             __END__