File Coverage

blib/lib/Mail/SpamAssassin/Locker.pm
Criterion Covered Total %
statement 23 31 74.1
branch n/a
condition 1 3 33.3
subroutine 7 11 63.6
pod 0 5 0.0
total 31 50 62.0


line stmt bran cond sub pod time code
1             # <@LICENSE>
2             # Licensed to the Apache Software Foundation (ASF) under one or more
3             # contributor license agreements. See the NOTICE file distributed with
4             # this work for additional information regarding copyright ownership.
5             # The ASF licenses this file to you under the Apache License, Version 2.0
6             # (the "License"); you may not use this file except in compliance with
7             # the License. You may obtain a copy of the License at:
8             #
9             # http://www.apache.org/licenses/LICENSE-2.0
10             #
11             # Unless required by applicable law or agreed to in writing, software
12             # distributed under the License is distributed on an "AS IS" BASIS,
13             # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14             # See the License for the specific language governing permissions and
15             # limitations under the License.
16             # </@LICENSE>
17              
18              
19             use strict;
20 26     26   148 use warnings;
  26         50  
  26         783  
21 26     26   137 # use bytes;
  26         46  
  26         733  
22             use re 'taint';
23 26     26   128 use Fcntl;
  26         61  
  26         979  
24 26     26   141 use Time::HiRes ();
  26         50  
  26         9612  
25 26     26   188  
  26         43  
  26         448  
26             use Mail::SpamAssassin;
27 26     26   123  
  26         41  
  26         5926  
28             our @ISA = qw();
29              
30             ###########################################################################
31              
32             my $class = shift;
33             $class = ref($class) || $class;
34 92     92 0 262 my $self = { };
35 92   33     605 bless ($self, $class);
36 92         220 $self;
37 92         186 }
38 92         243  
39             ###########################################################################
40              
41             my ($self, $path, $max_retries, $mode) = @_;
42             # max_retries is optional, should default to about 30
43             # mode is UNIX-style and optional, should default to 0700,
44 0     0 0   # callers must specify --x bits
45             die "locker: safe_lock not implemented by Locker subclass";
46             }
47              
48 0           ###########################################################################
49              
50             my ($self, $path) = @_;
51             die "locker: safe_unlock not implemented by Locker subclass";
52             }
53              
54 0     0 0   ###########################################################################
55 0            
56             my ($self, $path) = @_;
57             die "locker: refresh_lock not implemented by Locker subclass";
58             }
59              
60             ###########################################################################
61 0     0 0    
62 0           my ($self) = @_;
63             Time::HiRes::sleep(rand(1.0) + 0.5);
64             }
65              
66             ###########################################################################
67              
68 0     0 0   1;