Scoreboard/Dir.pm untested

filter: Statementstmt 0.0% 0 / 17 Branchbran n/a Conditioncond 0.0% 0 / 4 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 0.0% 0 / 7 Podpod 0.0% 0 / 5 totaltotal 0.0% 0 / 35 CC 1 SCAR 6.9
CC
1
Cov
0%
new
2.0
add
2.0
delete
2.0
CRAP 2.0
1 package Proc::Scoreboard::Dir;
2  
3 $Proc::Scoreboard::VERSION = (split " ", '# $Id: Dir.pm,v 1.1 2000/09/18 11:19:43 mkul Exp $ ')[3];;
4  
5 =head1 NAME
6  
7 Proc::Scoreboard - interface scoreboard class
8  
9 =head1 SYNOPSIS
10  
11 use Proc::Scoreboard::Dir;
12 my $scoreboard = new Proc::Scoreboard ( Directory => '/var/scoreboard' );
13 my @idList = $scoreboard->list ();
14 $scoreboard->add ( $pid );
15 $scoreboard->delete ( $pid );
16 $scoreboard->modify ( $pid, %hash );
17  
18 =head1 DESCRIPTION
19  
20 Intertface class for scoreboard.
21  
22 =cut
23  
24 =head2 new
25  
26 The constructor
27  
28 =cut
29  
30 use IO::Dir;
31 use IO::File;
32  
33 sub new
34 {
35 my ( $class, %params ) = @_;
36 my $this = $class->SUPER::new ( %params );
37 my $dirName = $this->{Directory} || die "You must pass Directory parameter for Proc::Scoreboard::Dir::new()";
38 $this->{dir} = new IO::Dir ( $dirName ) || "Error open dir $dirName; $!";
39 $this;
40 }
41  
42 =head2 add
43  
44 $sb->add ( $id );
45  
46 add new board with id $id to scoreboard
47  
48 =cut
49  
50 sub add
51 {
52 }
53  
54 =head2 delete
55  
56 $sb->delete ( $id );
57  
58 delete board with id $id from scoreboard
59  
60 =cut
61  
62 sub delete
63 {
64 }
65  
66 =head2 modify
67  
68 $db->modify ( $id, %hash );
69  
70 modify board with id $id by passed parameters
71  
72 =cut
73  
74 sub modify
75 {
76 }
77  
78 =head2 list
79  
80 return list of all known scoreboards id's
81  
82 =cut
83  
84 sub list
85 {
86 my $this = shift;
87 $this->{dir}->rewind();
88 my @result = $this->{dir}->read();
89 @result;
90 }
91  
92 1;
93  
94 __END__