File Coverage

lib/Clearcase/UCM/Pvob.pm
Criterion Covered Total %
statement 12 27 44.4
branch 0 4 0.0
condition n/a
subroutine 4 8 50.0
pod 4 4 100.0
total 20 43 46.5


line stmt bran cond sub pod time code
1              
2             =pod
3              
4             =head1 NAME Pvob.pm
5              
6             Object oriented interface to a UCM Pvob
7              
8             =head1 VERSION
9              
10             =over
11              
12             =item Author
13              
14             Andrew DeFaria
15              
16             =item Revision
17              
18             $Revision: 1.1 $
19              
20             =item Created
21              
22             Fri May 14 18:16:16 PDT 2010
23              
24             =item Modified
25              
26             $Date: 2011/11/09 01:52:39 $
27              
28             =back
29              
30             =head1 SYNOPSIS
31              
32             Provides access to information about a Clearcase Pvob.
33              
34             my $pvob = new Clearcase::UCM::Pvob ($name);
35              
36             =head1 DESCRIPTION
37              
38             This module implements a UCM Pvob object
39              
40             =head1 ROUTINES
41              
42             The following routines are exported:
43              
44             =cut
45              
46             package Clearcase::UCM::Pvob;
47              
48 1     1   931 use strict;
  1         1  
  1         26  
49 1     1   3 use warnings;
  1         1  
  1         48  
50              
51 1     1   4 use parent 'Clearcase::Vob';
  1         2  
  1         18  
52              
53 1     1   114 use Carp;
  1         1  
  1         297  
54              
55             sub new ($) {
56 0     0 1   my ($class, $tag) = @_;
57              
58             =pod
59              
60             =head2 new
61              
62             Construct a new Clearcase Pvob object.
63              
64             Parameters:
65              
66             =for html
67              
68             =over
69              
70             =item name
71              
72             Name of pvob
73              
74             =back
75              
76             =for html
77              
78             Returns:
79              
80             =for html
81              
82             =over
83              
84             =item Clearcase Pvob object
85              
86             =back
87              
88             =for html
89              
90             =cut
91              
92 0 0         croak 'Clearcase::UCM::Pvob: Must specify pvob tag' unless $tag;
93              
94 0           $class = bless {
95             tag => $tag,
96             ucmproject => 1,
97             },
98             $class; # bless
99              
100 0           $class->updateVobInfo;
101              
102 0           return $class;
103             } # new
104              
105             sub tag() {
106 0     0 1   my ($self) = @_;
107              
108             =pod
109              
110             =head2 tag
111              
112             Returns the tag of the pvob
113              
114             Parameters:
115              
116             =for html
117              
118             =over
119              
120             =item none
121              
122             =back
123              
124             =for html
125              
126             Returns:
127              
128             =for html
129              
130             =over
131              
132             =item tag
133              
134             =back
135              
136             =for html
137              
138             =cut
139              
140 0           return $self->{tag};
141             } # tag
142              
143             # Alias name to tag
144             sub name() {
145 0     0 1   goto &tag;
146             } # name
147              
148             sub streams () {
149 0     0 1   my ($self) = @_;
150              
151             =pod
152              
153             =head2 streams
154              
155             Returns an array of stream objects in the pvob
156              
157             Parameters:
158              
159             =for html
160              
161             =over
162              
163             =item none
164              
165             =back
166              
167             =for html
168              
169             Returns:
170              
171             =for html
172              
173             =over
174              
175             =item array of stream objects in the pvob
176              
177             =back
178              
179             =for html
180              
181             =cut
182              
183 0           my $cmd = "lsstream -short -invob $self->{name}";
184              
185 0           $Clearcase::CC->execute ($cmd);
186              
187 0 0         return if $Clearcase::CC->status;
188              
189 0           my @streams;
190              
191             push @streams, Clearcase::UCM::Stream->new ($_, $self->{name})
192 0           for ($Clearcase::CC->output);
193              
194 0           return @streams;
195             } # streams
196              
197             1;
198              
199             =head1 DEPENDENCIES
200              
201             =head2 Modules
202              
203             =over
204              
205             =item L
206              
207             =item L
208              
209             =back
210              
211             =head1 INCOMPATABILITIES
212              
213             None
214              
215             =head1 BUGS AND LIMITATIONS
216              
217             There are no known bugs in this module.
218              
219             Please report problems to Andrew DeFaria .
220              
221             =head1 COPYRIGHT AND LICENSE
222              
223             Copyright (C) 2020 by Andrew@DeFaria.com
224              
225             This library is free software; you can redistribute it and/or modify
226             it under the same terms as Perl itself, either Perl version 5.38.0 or,
227             at your option, any later version of Perl 5 you may have available.
228              
229             =cut