File Coverage

blib/lib/Pinto/Action/Nop.pm
Criterion Covered Total %
statement 15 17 88.2
branch 1 2 50.0
condition n/a
subroutine 5 5 100.0
pod 0 1 0.0
total 21 25 84.0


line stmt bran cond sub pod time code
1             # ABSTRACT: A no-op action
2              
3             package Pinto::Action::Nop;
4              
5 2     2   1580 use Moose;
  2         4  
  2         24  
6 2     2   15386 use MooseX::StrictConstructor;
  2         6  
  2         38  
7 2     2   7192 use MooseX::Types::Moose qw(Int);
  2         6  
  2         34  
8 2     2   9670 use MooseX::MarkAsMethods ( autoclean => 1 );
  2         4  
  2         22  
9              
10             #------------------------------------------------------------------------------
11              
12             our $VERSION = '0.14'; # VERSION
13              
14             #------------------------------------------------------------------------------
15              
16             extends qw( Pinto::Action );
17              
18             #------------------------------------------------------------------------------
19              
20             has sleep => (
21             is => 'ro',
22             isa => Int,
23             default => 0,
24             );
25              
26             #------------------------------------------------------------------------------
27              
28             sub execute {
29 2     2 0 8 my ($self) = @_;
30              
31 2 50       54 if ( my $sleep = $self->sleep ) {
32 0         0 $self->notice("Process $$ sleeping for $sleep seconds");
33 0         0 sleep $self->sleep;
34             }
35              
36 2         56 return $self->result;
37             }
38              
39             #------------------------------------------------------------------------------
40              
41             __PACKAGE__->meta->make_immutable();
42              
43             #------------------------------------------------------------------------------
44              
45              
46             1;
47              
48             __END__
49              
50             =pod
51              
52             =encoding UTF-8
53              
54             =for :stopwords Jeffrey Ryan Thalhammer
55              
56             =head1 NAME
57              
58             Pinto::Action::Nop - A no-op action
59              
60             =head1 VERSION
61              
62             version 0.14
63              
64             =head1 DESCRIPTION
65              
66             This action does nothing. It can be used to get Pinto to initialize
67             the store and load the indexes without performing any real operations
68             on them.
69              
70             =head1 AUTHOR
71              
72             Jeffrey Ryan Thalhammer <jeff@stratopan.com>
73              
74             =head1 COPYRIGHT AND LICENSE
75              
76             This software is copyright (c) 2015 by Jeffrey Ryan Thalhammer.
77              
78             This is free software; you can redistribute it and/or modify it under
79             the same terms as the Perl 5 programming language system itself.
80              
81             =cut