line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Toader; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
4
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
21
|
|
5
|
1
|
|
|
1
|
|
519
|
use Toader::isaToaderDir; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use Toader::findToaderRoot; |
7
|
|
|
|
|
|
|
use base 'Error::Helper'; |
8
|
|
|
|
|
|
|
use Toader::pathHelper; |
9
|
|
|
|
|
|
|
use Toader::findToaderRoot; |
10
|
|
|
|
|
|
|
use Toader::Directory; |
11
|
|
|
|
|
|
|
use Sys::Hostname; |
12
|
|
|
|
|
|
|
use Toader::Config; |
13
|
|
|
|
|
|
|
use Toader::VCS; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 NAME |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
Toader - A CMS meant to be integrated with a versioning system. |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 VERSION |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
Version 1.2.0 |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=cut |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
our $VERSION = '1.2.0'; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 SYNOPSIS |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
use Toader; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
my $foo = Toader->new({dir=>$toaderDir}); |
32
|
|
|
|
|
|
|
if ( $foo->error ){ |
33
|
|
|
|
|
|
|
warn('Error:'.$foo->error.': '.$foo->errorString); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 METHODS |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head2 new |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head3 args hash ref |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head4 dir |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
This is the directory to intiate in. |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
This is required and needs to be a Toader directory. |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head4 outputdir |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
This is the output directory to use when rendering. |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
my $toader=Toader->new(\%args); |
53
|
|
|
|
|
|
|
if ( $toader->error ){ |
54
|
|
|
|
|
|
|
warn('Error:'.$toader->error.':'.$toader->errorFlag.': '.$toader->errorString); |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=cut |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub new{ |
60
|
|
|
|
|
|
|
my %args; |
61
|
|
|
|
|
|
|
if(defined($_[1])){ |
62
|
|
|
|
|
|
|
%args= %{$_[1]}; |
63
|
|
|
|
|
|
|
}; |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
my $self={ |
66
|
|
|
|
|
|
|
error=>undef, |
67
|
|
|
|
|
|
|
errorString=>'', |
68
|
|
|
|
|
|
|
isatd=>Toader::isaToaderDir->new, |
69
|
|
|
|
|
|
|
perror=>undef, |
70
|
|
|
|
|
|
|
outputdir=>undef, |
71
|
|
|
|
|
|
|
errorExtra=>{ |
72
|
|
|
|
|
|
|
flags=>{ |
73
|
|
|
|
|
|
|
1=>'noDirSpecified', |
74
|
|
|
|
|
|
|
2=>'isaToaderDirError', |
75
|
|
|
|
|
|
|
3=>'notAtoaderDir', |
76
|
|
|
|
|
|
|
4=>'outputIsAtoaderDir', |
77
|
|
|
|
|
|
|
5=>'DirectoryInitError', |
78
|
|
|
|
|
|
|
6=>'ConfigInitError', |
79
|
|
|
|
|
|
|
7=>'PathHerlerInitError', |
80
|
|
|
|
|
|
|
8=>'VCSinitError', |
81
|
|
|
|
|
|
|
9=>'VCSusableError', |
82
|
|
|
|
|
|
|
}, |
83
|
|
|
|
|
|
|
}, |
84
|
|
|
|
|
|
|
}; |
85
|
|
|
|
|
|
|
bless $self; |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
#makes sure we have a directory |
88
|
|
|
|
|
|
|
if (!defined( $args{dir} )) { |
89
|
|
|
|
|
|
|
$self->{error}=1; |
90
|
|
|
|
|
|
|
$self->{errorString}='No directory specified'; |
91
|
|
|
|
|
|
|
$self->warn; |
92
|
|
|
|
|
|
|
return $self; |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
#makes sure it is a Toader directory |
96
|
|
|
|
|
|
|
my $results=$self->{isatd}->isaToaderDir($args{dir}); |
97
|
|
|
|
|
|
|
if ($self->{isatd}->error) { |
98
|
|
|
|
|
|
|
$self->{error}=2; |
99
|
|
|
|
|
|
|
$self->{errorString}='$self->{isatd}->isaToaderDir($args{dir}) errored. error='.$self->{isatd}->error. |
100
|
|
|
|
|
|
|
' errorString="'.$self->{isatd}->errorString.'"'; |
101
|
|
|
|
|
|
|
$self->warn; |
102
|
|
|
|
|
|
|
return $self; |
103
|
|
|
|
|
|
|
} |
104
|
|
|
|
|
|
|
if (!$results) { |
105
|
|
|
|
|
|
|
$self->{error}=3; |
106
|
|
|
|
|
|
|
$self->{errorString}='"'.$args{dir}.'" is not a Toader directory'; |
107
|
|
|
|
|
|
|
$self->warn; |
108
|
|
|
|
|
|
|
return $self; |
109
|
|
|
|
|
|
|
} |
110
|
|
|
|
|
|
|
$self->{dir}=$args{dir}; |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
#finds the Toader root |
113
|
|
|
|
|
|
|
my $findroot=Toader::findToaderRoot->new; |
114
|
|
|
|
|
|
|
$self->{dir}=$findroot->findToaderRoot( $self->{dir} ); |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
#make sure it is clean |
117
|
|
|
|
|
|
|
$self->{pathHelper}=Toader::pathHelper->new( $self->{dir} ); |
118
|
|
|
|
|
|
|
$self->{dir}=$self->{pathHelper}->cleanup( $self->{dir} ); |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
#handles the output directory if specified |
121
|
|
|
|
|
|
|
if( defined( $args{outputdir} ) ){ |
122
|
|
|
|
|
|
|
$results=$self->{isatd}->isaToaderDir( $args{outputdir} ); |
123
|
|
|
|
|
|
|
if( $self->{isatd}->error ){ |
124
|
|
|
|
|
|
|
$self->{perror}=1; |
125
|
|
|
|
|
|
|
$self->{error}=2; |
126
|
|
|
|
|
|
|
$self->{errorString}='$self->{isatd}->isaToaderDir($args{outputdir}) errored. error=' |
127
|
|
|
|
|
|
|
.$self->{isatd}->error.' errorString="'.$self->{isatd}->errorString.'"'; |
128
|
|
|
|
|
|
|
$self->warn; |
129
|
|
|
|
|
|
|
return $self; |
130
|
|
|
|
|
|
|
} |
131
|
|
|
|
|
|
|
if ($results) { |
132
|
|
|
|
|
|
|
$self->{perror}=1; |
133
|
|
|
|
|
|
|
$self->{error}=4; |
134
|
|
|
|
|
|
|
$self->{errorString}='"'.$args{outputdir}.'" can not be used as a out put directory'. |
135
|
|
|
|
|
|
|
' as it is a Toader directory'; |
136
|
|
|
|
|
|
|
$self->warn; |
137
|
|
|
|
|
|
|
return $self; |
138
|
|
|
|
|
|
|
} |
139
|
|
|
|
|
|
|
$self->{outputdir}=$args{outputdir}; |
140
|
|
|
|
|
|
|
} |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
# intialize the VCS integration |
143
|
|
|
|
|
|
|
$self->{vcs}=Toader::VCS->new($self); |
144
|
|
|
|
|
|
|
if ( $self->{vcs}->error ){ |
145
|
|
|
|
|
|
|
$self->{perror}=1; |
146
|
|
|
|
|
|
|
$self->{error}=8; |
147
|
|
|
|
|
|
|
$self->{errorString}='Failed to initiate VCS. error="'. |
148
|
|
|
|
|
|
|
$self->{vcs}->error.'" errorString="'.$self->{vcs}->errorString.'"'; |
149
|
|
|
|
|
|
|
$self->warn; |
150
|
|
|
|
|
|
|
return $self; |
151
|
|
|
|
|
|
|
} |
152
|
|
|
|
|
|
|
# VCS usable |
153
|
|
|
|
|
|
|
$self->{VCSusable}=$self->{vcs}->usable; |
154
|
|
|
|
|
|
|
if ( $self->{vcs}->error ){ |
155
|
|
|
|
|
|
|
$self->{perror}=1; |
156
|
|
|
|
|
|
|
$self->{error}=9; |
157
|
|
|
|
|
|
|
$self->{errorString}='Toader::VCS->usable errored. error="'. |
158
|
|
|
|
|
|
|
$self->{vcs}->error.'" errorString="'.$self->{vcs}->errorString.'"'; |
159
|
|
|
|
|
|
|
$self->warn; |
160
|
|
|
|
|
|
|
return $self; |
161
|
|
|
|
|
|
|
} |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
# initialize the config |
164
|
|
|
|
|
|
|
$self->{config}=Toader::Config->new( $self ); |
165
|
|
|
|
|
|
|
if ( $self->{config}->error ){ |
166
|
|
|
|
|
|
|
$self->{perror}=1; |
167
|
|
|
|
|
|
|
$self->{error}=6; |
168
|
|
|
|
|
|
|
$self->{errorString}='Failed to initialize Toader::Config. error="' |
169
|
|
|
|
|
|
|
.$self->{config}->error.'" errorString="'.$self->{config}->errorString.'"'; |
170
|
|
|
|
|
|
|
$self->warn; |
171
|
|
|
|
|
|
|
return $self; |
172
|
|
|
|
|
|
|
} |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
# initialize the path helper |
175
|
|
|
|
|
|
|
$self->{ph}=Toader::pathHelper->new( $self->{dir} ); |
176
|
|
|
|
|
|
|
if ( $self->{ph}->error ){ |
177
|
|
|
|
|
|
|
$self->{perror}=1; |
178
|
|
|
|
|
|
|
$self->{error}=7; |
179
|
|
|
|
|
|
|
$self->{errorString}='Failed to initiate pathHelper. error="'. |
180
|
|
|
|
|
|
|
$self->{ph}->error.'" errorString="'.$self->{ph}->errorString.'"'; |
181
|
|
|
|
|
|
|
$self->warn; |
182
|
|
|
|
|
|
|
return $self; |
183
|
|
|
|
|
|
|
} |
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
return $self; |
186
|
|
|
|
|
|
|
} |
187
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
=head2 getConfig |
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
This returns the L object storing the Toader |
191
|
|
|
|
|
|
|
config. |
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
There is no need to do any error checking as long as |
194
|
|
|
|
|
|
|
Toader new suceeded with out issue. |
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
my $config=$toader->getConfig; |
197
|
|
|
|
|
|
|
if ( $toader->error ){ |
198
|
|
|
|
|
|
|
warn('Error:'.$toader->error.':'.$toader->errorFlag.': '.$toader->errorString); |
199
|
|
|
|
|
|
|
} |
200
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
=cut |
202
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
sub getConfig{ |
204
|
|
|
|
|
|
|
my $self=$_[0]; |
205
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
#blank any previous errors |
207
|
|
|
|
|
|
|
if(!$self->errorblank){ |
208
|
|
|
|
|
|
|
return undef; |
209
|
|
|
|
|
|
|
} |
210
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
return $self->{config}->getConfig; |
212
|
|
|
|
|
|
|
} |
213
|
|
|
|
|
|
|
|
214
|
|
|
|
|
|
|
=head2 getConfigObj |
215
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
This returns the L object that was created |
217
|
|
|
|
|
|
|
when this module was created. |
218
|
|
|
|
|
|
|
|
219
|
|
|
|
|
|
|
my $configObj=$toader->getConfigObj; |
220
|
|
|
|
|
|
|
if ( $toader->error ){ |
221
|
|
|
|
|
|
|
warn('Error:'.$toader->error.':'.$toader->errorFlag.': '.$toader->errorString); |
222
|
|
|
|
|
|
|
} |
223
|
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
=cut |
225
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
sub getConfigObj{ |
227
|
|
|
|
|
|
|
my $self=$_[0]; |
228
|
|
|
|
|
|
|
|
229
|
|
|
|
|
|
|
#blank any previous errors |
230
|
|
|
|
|
|
|
if(!$self->errorblank){ |
231
|
|
|
|
|
|
|
return undef; |
232
|
|
|
|
|
|
|
} |
233
|
|
|
|
|
|
|
|
234
|
|
|
|
|
|
|
return $self->{config}; |
235
|
|
|
|
|
|
|
} |
236
|
|
|
|
|
|
|
|
237
|
|
|
|
|
|
|
=head2 getDirObj |
238
|
|
|
|
|
|
|
|
239
|
|
|
|
|
|
|
This returns a L object with the directory |
240
|
|
|
|
|
|
|
set to the Toader root. |
241
|
|
|
|
|
|
|
|
242
|
|
|
|
|
|
|
my $dirobj=$toader->getDirObj; |
243
|
|
|
|
|
|
|
if ( $toader->error ){ |
244
|
|
|
|
|
|
|
warn('Error:'.$toader->error.':'.$toader->errorFlag.': '.$toader->errorString); |
245
|
|
|
|
|
|
|
} |
246
|
|
|
|
|
|
|
|
247
|
|
|
|
|
|
|
=cut |
248
|
|
|
|
|
|
|
|
249
|
|
|
|
|
|
|
sub getDirObj{ |
250
|
|
|
|
|
|
|
my $self=$_[0]; |
251
|
|
|
|
|
|
|
|
252
|
|
|
|
|
|
|
#blank any previous errors |
253
|
|
|
|
|
|
|
if(!$self->errorblank){ |
254
|
|
|
|
|
|
|
return undef; |
255
|
|
|
|
|
|
|
} |
256
|
|
|
|
|
|
|
|
257
|
|
|
|
|
|
|
my $dirobj=Toader::Directory->new( $self ); |
258
|
|
|
|
|
|
|
|
259
|
|
|
|
|
|
|
$dirobj->dirSet( $self->{dir} ); |
260
|
|
|
|
|
|
|
if ( $dirobj->error ){ |
261
|
|
|
|
|
|
|
$self->{error}=5; |
262
|
|
|
|
|
|
|
$self->{errorString}='Could not set the directory for the newly created '. |
263
|
|
|
|
|
|
|
'Toader::Directory object to "'.$self->{dir}.'"'; |
264
|
|
|
|
|
|
|
$self->warn; |
265
|
|
|
|
|
|
|
return undef; |
266
|
|
|
|
|
|
|
} |
267
|
|
|
|
|
|
|
|
268
|
|
|
|
|
|
|
return $dirobj; |
269
|
|
|
|
|
|
|
} |
270
|
|
|
|
|
|
|
|
271
|
|
|
|
|
|
|
=head2 getOutputDir |
272
|
|
|
|
|
|
|
|
273
|
|
|
|
|
|
|
This returns the output directory. |
274
|
|
|
|
|
|
|
|
275
|
|
|
|
|
|
|
If none is specified, undef is returned. |
276
|
|
|
|
|
|
|
|
277
|
|
|
|
|
|
|
There is no reason for check for errors if new |
278
|
|
|
|
|
|
|
succeeded with out error. |
279
|
|
|
|
|
|
|
|
280
|
|
|
|
|
|
|
my $outputdir=$toader->getOutputDir; |
281
|
|
|
|
|
|
|
if( defined( $outputdir ) ){ |
282
|
|
|
|
|
|
|
print "outputdir='".$outputdir."'\n"; |
283
|
|
|
|
|
|
|
}else{ |
284
|
|
|
|
|
|
|
print "No output directory defined.\n"; |
285
|
|
|
|
|
|
|
} |
286
|
|
|
|
|
|
|
|
287
|
|
|
|
|
|
|
=cut |
288
|
|
|
|
|
|
|
|
289
|
|
|
|
|
|
|
sub getOutputDir{ |
290
|
|
|
|
|
|
|
my $self=$_[0]; |
291
|
|
|
|
|
|
|
|
292
|
|
|
|
|
|
|
#blank any previous errors |
293
|
|
|
|
|
|
|
if(!$self->errorblank){ |
294
|
|
|
|
|
|
|
return undef; |
295
|
|
|
|
|
|
|
} |
296
|
|
|
|
|
|
|
|
297
|
|
|
|
|
|
|
return $self->{outputdir}; |
298
|
|
|
|
|
|
|
} |
299
|
|
|
|
|
|
|
|
300
|
|
|
|
|
|
|
=head2 getPathHelper |
301
|
|
|
|
|
|
|
|
302
|
|
|
|
|
|
|
This returns a L object for this Toader object. |
303
|
|
|
|
|
|
|
|
304
|
|
|
|
|
|
|
If the Toader object initialized with out issue, then there is no reason |
305
|
|
|
|
|
|
|
to check for an error. |
306
|
|
|
|
|
|
|
|
307
|
|
|
|
|
|
|
my $pathHelper=$toader->getPathHelper; |
308
|
|
|
|
|
|
|
if ( $toader->error ){ |
309
|
|
|
|
|
|
|
warn('Error:'.$toader->error.':'.$toader->errorFlag.': '.$toader->errorString); |
310
|
|
|
|
|
|
|
} |
311
|
|
|
|
|
|
|
|
312
|
|
|
|
|
|
|
=cut |
313
|
|
|
|
|
|
|
|
314
|
|
|
|
|
|
|
sub getPathHelper{ |
315
|
|
|
|
|
|
|
my $self=$_[0]; |
316
|
|
|
|
|
|
|
|
317
|
|
|
|
|
|
|
#blank any previous errors |
318
|
|
|
|
|
|
|
if(!$self->errorblank){ |
319
|
|
|
|
|
|
|
return undef; |
320
|
|
|
|
|
|
|
} |
321
|
|
|
|
|
|
|
|
322
|
|
|
|
|
|
|
return $self->{ph}; |
323
|
|
|
|
|
|
|
} |
324
|
|
|
|
|
|
|
|
325
|
|
|
|
|
|
|
=head2 getRootDir |
326
|
|
|
|
|
|
|
|
327
|
|
|
|
|
|
|
This returns the root directory for what Toader is using. |
328
|
|
|
|
|
|
|
|
329
|
|
|
|
|
|
|
If the returned value is not defined, one has not been set yet. |
330
|
|
|
|
|
|
|
|
331
|
|
|
|
|
|
|
my $rootdir=$toader->getRootDir; |
332
|
|
|
|
|
|
|
if ( $foo->error ){ |
333
|
|
|
|
|
|
|
warn('Error:'.$foo->error.':'.$toader->errorFlag.': '.$foo->errorString); |
334
|
|
|
|
|
|
|
} |
335
|
|
|
|
|
|
|
|
336
|
|
|
|
|
|
|
=cut |
337
|
|
|
|
|
|
|
|
338
|
|
|
|
|
|
|
sub getRootDir{ |
339
|
|
|
|
|
|
|
my $self=$_[0]; |
340
|
|
|
|
|
|
|
my $dir=$_[1]; |
341
|
|
|
|
|
|
|
|
342
|
|
|
|
|
|
|
#blank any previous errors |
343
|
|
|
|
|
|
|
if(!$self->errorblank){ |
344
|
|
|
|
|
|
|
return undef; |
345
|
|
|
|
|
|
|
} |
346
|
|
|
|
|
|
|
|
347
|
|
|
|
|
|
|
return $self->{dir}; |
348
|
|
|
|
|
|
|
} |
349
|
|
|
|
|
|
|
|
350
|
|
|
|
|
|
|
=head2 setOutputDir |
351
|
|
|
|
|
|
|
|
352
|
|
|
|
|
|
|
This sets the output directory. |
353
|
|
|
|
|
|
|
|
354
|
|
|
|
|
|
|
$foo->setOutputDir( $dir ); |
355
|
|
|
|
|
|
|
if ( $foo->error ){ |
356
|
|
|
|
|
|
|
warn('Error:'.$foo->error.':'.$toader->errorFlag.': '.$foo->errorString); |
357
|
|
|
|
|
|
|
} |
358
|
|
|
|
|
|
|
|
359
|
|
|
|
|
|
|
=cut |
360
|
|
|
|
|
|
|
|
361
|
|
|
|
|
|
|
sub setOutputDir{ |
362
|
|
|
|
|
|
|
my $self=$_[0]; |
363
|
|
|
|
|
|
|
my $dir=$_[1]; |
364
|
|
|
|
|
|
|
|
365
|
|
|
|
|
|
|
#blank any previous errors |
366
|
|
|
|
|
|
|
if(!$self->errorblank){ |
367
|
|
|
|
|
|
|
return undef; |
368
|
|
|
|
|
|
|
} |
369
|
|
|
|
|
|
|
|
370
|
|
|
|
|
|
|
#makes sure it is a directory |
371
|
|
|
|
|
|
|
if ( ! defined($dir) ){ |
372
|
|
|
|
|
|
|
$self->{error}=1; |
373
|
|
|
|
|
|
|
$self->{errorString}='No directory defined'; |
374
|
|
|
|
|
|
|
$self->warn; |
375
|
|
|
|
|
|
|
return undef; |
376
|
|
|
|
|
|
|
} |
377
|
|
|
|
|
|
|
|
378
|
|
|
|
|
|
|
my $results=$self->{isatd}->isaToaderDir( $dir ); |
379
|
|
|
|
|
|
|
if( $self->{isatd}->error ){ |
380
|
|
|
|
|
|
|
$self->{perror}=1; |
381
|
|
|
|
|
|
|
$self->{error}=2; |
382
|
|
|
|
|
|
|
$self->{errorString}='$self->{isatd}->isaToaderDir($args{outputdir}) errored. error=' |
383
|
|
|
|
|
|
|
.$self->{isatd}->error.' errorString="'.$self->{isatd}->errorString.'"'; |
384
|
|
|
|
|
|
|
$self->warn; |
385
|
|
|
|
|
|
|
return undef; |
386
|
|
|
|
|
|
|
} |
387
|
|
|
|
|
|
|
if ($results) { |
388
|
|
|
|
|
|
|
$self->{error}=4; |
389
|
|
|
|
|
|
|
$self->{errorString}='"'.$dir.'" can not be used as a out put directory'. |
390
|
|
|
|
|
|
|
'as it is a Toader directory'; |
391
|
|
|
|
|
|
|
$self->warn; |
392
|
|
|
|
|
|
|
return undef; |
393
|
|
|
|
|
|
|
} |
394
|
|
|
|
|
|
|
$self->{outputdir}=$dir; |
395
|
|
|
|
|
|
|
|
396
|
|
|
|
|
|
|
return 1; |
397
|
|
|
|
|
|
|
} |
398
|
|
|
|
|
|
|
|
399
|
|
|
|
|
|
|
=head2 getVCS |
400
|
|
|
|
|
|
|
|
401
|
|
|
|
|
|
|
This returns to the L object. |
402
|
|
|
|
|
|
|
|
403
|
|
|
|
|
|
|
my $vcs=$toader->getVCS; |
404
|
|
|
|
|
|
|
if ( $toader->error ){ |
405
|
|
|
|
|
|
|
warn('Error:'.$toader->error.':'.$toader->errorFlag.': '.$toader->errorString); |
406
|
|
|
|
|
|
|
} |
407
|
|
|
|
|
|
|
|
408
|
|
|
|
|
|
|
=cut |
409
|
|
|
|
|
|
|
|
410
|
|
|
|
|
|
|
sub getVCS{ |
411
|
|
|
|
|
|
|
my $self=$_[0]; |
412
|
|
|
|
|
|
|
|
413
|
|
|
|
|
|
|
#blank any previous errors |
414
|
|
|
|
|
|
|
if(!$self->errorblank){ |
415
|
|
|
|
|
|
|
return undef; |
416
|
|
|
|
|
|
|
} |
417
|
|
|
|
|
|
|
|
418
|
|
|
|
|
|
|
return $self->{vcs}; |
419
|
|
|
|
|
|
|
} |
420
|
|
|
|
|
|
|
|
421
|
|
|
|
|
|
|
=head1 ERROR CODES |
422
|
|
|
|
|
|
|
|
423
|
|
|
|
|
|
|
=head2 1, noDirSpecified |
424
|
|
|
|
|
|
|
|
425
|
|
|
|
|
|
|
No directory specified. |
426
|
|
|
|
|
|
|
|
427
|
|
|
|
|
|
|
=head2 2, isaToaderDirError |
428
|
|
|
|
|
|
|
|
429
|
|
|
|
|
|
|
Toader::isaToaderDir->isaToaderDir errored. |
430
|
|
|
|
|
|
|
|
431
|
|
|
|
|
|
|
=head2 3, notAtoaderDir |
432
|
|
|
|
|
|
|
|
433
|
|
|
|
|
|
|
The specified directory is not a Toader directory. |
434
|
|
|
|
|
|
|
|
435
|
|
|
|
|
|
|
=head2 4, outputIsAtoaderDir |
436
|
|
|
|
|
|
|
|
437
|
|
|
|
|
|
|
The specified output directory is a Toader directory. |
438
|
|
|
|
|
|
|
|
439
|
|
|
|
|
|
|
=head2 5, DirectoryInitError |
440
|
|
|
|
|
|
|
|
441
|
|
|
|
|
|
|
Could initialize the L object. |
442
|
|
|
|
|
|
|
|
443
|
|
|
|
|
|
|
=head2 6, ConfigInitError |
444
|
|
|
|
|
|
|
|
445
|
|
|
|
|
|
|
Failed to initialize L. |
446
|
|
|
|
|
|
|
|
447
|
|
|
|
|
|
|
=head2 7, PathHerlerInitError |
448
|
|
|
|
|
|
|
|
449
|
|
|
|
|
|
|
Failed to initiate the path helper. |
450
|
|
|
|
|
|
|
|
451
|
|
|
|
|
|
|
=head2 8, VCSinitError |
452
|
|
|
|
|
|
|
|
453
|
|
|
|
|
|
|
Failed to initiate VCS integration. |
454
|
|
|
|
|
|
|
|
455
|
|
|
|
|
|
|
=head2 9, VCSusableError |
456
|
|
|
|
|
|
|
|
457
|
|
|
|
|
|
|
Toader::VCS->usable errored. |
458
|
|
|
|
|
|
|
|
459
|
|
|
|
|
|
|
=head1 AUTHOR |
460
|
|
|
|
|
|
|
|
461
|
|
|
|
|
|
|
Zane C. Bowers-Hadley, C<< >> |
462
|
|
|
|
|
|
|
|
463
|
|
|
|
|
|
|
|
464
|
|
|
|
|
|
|
=head1 BUGS |
465
|
|
|
|
|
|
|
|
466
|
|
|
|
|
|
|
Please report any bugs or feature requests to C, or through |
467
|
|
|
|
|
|
|
the web interface at L. I will be notified, and then you'll |
468
|
|
|
|
|
|
|
automatically be notified of progress on your bug as I make changes. |
469
|
|
|
|
|
|
|
|
470
|
|
|
|
|
|
|
|
471
|
|
|
|
|
|
|
|
472
|
|
|
|
|
|
|
|
473
|
|
|
|
|
|
|
=head1 SUPPORT |
474
|
|
|
|
|
|
|
|
475
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
476
|
|
|
|
|
|
|
|
477
|
|
|
|
|
|
|
perldoc Toader |
478
|
|
|
|
|
|
|
|
479
|
|
|
|
|
|
|
|
480
|
|
|
|
|
|
|
You can also look for information at: |
481
|
|
|
|
|
|
|
|
482
|
|
|
|
|
|
|
=over 4 |
483
|
|
|
|
|
|
|
|
484
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker |
485
|
|
|
|
|
|
|
|
486
|
|
|
|
|
|
|
L |
487
|
|
|
|
|
|
|
|
488
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
489
|
|
|
|
|
|
|
|
490
|
|
|
|
|
|
|
L |
491
|
|
|
|
|
|
|
|
492
|
|
|
|
|
|
|
=item * CPAN Ratings |
493
|
|
|
|
|
|
|
|
494
|
|
|
|
|
|
|
L |
495
|
|
|
|
|
|
|
|
496
|
|
|
|
|
|
|
=item * Search CPAN |
497
|
|
|
|
|
|
|
|
498
|
|
|
|
|
|
|
L |
499
|
|
|
|
|
|
|
|
500
|
|
|
|
|
|
|
=back |
501
|
|
|
|
|
|
|
|
502
|
|
|
|
|
|
|
|
503
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
504
|
|
|
|
|
|
|
|
505
|
|
|
|
|
|
|
|
506
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
507
|
|
|
|
|
|
|
|
508
|
|
|
|
|
|
|
Copyright 2013 Zane C. Bowers-Hadley |
509
|
|
|
|
|
|
|
|
510
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
511
|
|
|
|
|
|
|
under the terms of either: the GNU General Public License as published |
512
|
|
|
|
|
|
|
by the Free Software Foundation; or the Artistic License. |
513
|
|
|
|
|
|
|
|
514
|
|
|
|
|
|
|
See http://dev.perl.org/licenses/ for more information. |
515
|
|
|
|
|
|
|
|
516
|
|
|
|
|
|
|
|
517
|
|
|
|
|
|
|
=cut |
518
|
|
|
|
|
|
|
|
519
|
|
|
|
|
|
|
1; # End of Toader |