Removed /usr/local from CDPATH
[clearscm.git] / lib / Clearcase / UCM.pm
1 =pod
2
3 =head1 NAME $RCSfile: UCM.pm,v $
4
5 Object oriented interface to UCM Streams
6
7 =head1 VERSION
8
9 =over
10
11 =item Author
12
13 Andrew DeFaria <Andrew@ClearSCM.com>
14
15 =item Revision
16
17 $Revision: 1.2 $
18
19 =item Created
20
21 Fri May 14 18:16:16 PDT 2010
22
23 =item Modified
24
25 $Date: 2011/11/16 19:46:13 $
26
27 =back
28
29 =head1 SYNOPSIS
30
31 Provides access to information about Clearcase Elements.
32
33   my $stream= new Clearcase::UCM::Stream ($name, $pvob);
34
35 =head1 DESCRIPTION
36
37 This module implements a UCM Stream object
38
39 =head1 ROUTINES
40
41 The following routines are exported:
42
43 =cut
44
45 package Clearcase::UCM;
46
47 use strict;
48 use warnings;
49
50 use Clearcase;
51 use Clearcase::Vob;
52 use Clearcase::Vobs;
53
54 sub new ($) {
55   my ($class, $stream) = @_;
56
57 =pod
58
59 =head2 new
60
61 Construct a new Clearcase Stream object.
62
63 Parameters:
64
65 =for html <blockquote>
66
67 =over
68
69 =item stream name
70
71 Name of stream
72
73 =back
74
75 =for html </blockquote>
76
77 Returns:
78
79 =for html <blockquote>
80
81 =over
82
83 =item Clearcase Stream object
84
85 =back
86
87 =for html </blockquote>
88
89 =cut
90
91   return bless {
92   }, $class; # bless
93 } # new
94
95 sub pvobs () {
96   my ($self) = @_;
97
98 =pod
99
100 =head2 pvob
101
102 Returns the pvob of the stream
103
104 Parameters:
105
106 =for html <blockquote>
107
108 =over
109
110 =item none
111
112 =back
113
114 =for html </blockquote>
115
116 Returns:
117
118 =for html <blockquote>
119
120 =over
121
122 =item stream's pvob
123
124 =back
125
126 =for html </blockquote>
127
128 =cut
129
130   my @pvobs;
131   
132   my $VOBs = Clearcase::Vobs->new;
133   
134   foreach my $vobtag ($VOBs->vobs) {
135     my $VOB  = Clearcase::Vob->new ("$Clearcase::VOBTAG_PREFIX$vobtag");
136     my $attr = $VOB->vob_registry_attributes;
137     
138     if ($attr and $attr =~ /ucmvob/) {
139       push @pvobs, $vobtag;
140     } # if
141   } # foreach
142   
143   return @pvobs;
144 } # pvobs
145
146 1;
147
148 =head1 DEPENDENCIES
149
150 =head2 ClearSCM Perl Modules
151
152 =for html <p><a href="/php/scm_man.php?file=lib/Clearcase.pm">Clearcase</a></p>
153
154 =head1 INCOMPATABILITIES
155
156 None
157
158 =head1 BUGS AND LIMITATIONS
159
160 There are no known bugs in this module.
161
162 Please report problems to Andrew DeFaria <Andrew@ClearSCM.com>.
163
164 =head1 LICENSE AND COPYRIGHT
165
166 Copyright (c) 2007, ClearSCM, Inc. All rights reserved.
167
168 =cut