Toader/Gallery.pm

filter: Statementstmt 3.6% 17 / 465 Branchbran 0.0% 0 / 222 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 13.8% 5 / 36 Podpod 100% 31 / 31 totaltotal 7.0% 53 / 754 CC 112 SCAR 37.7
CC
112
Cov
2%
usable
132.0
delConfig
72.0
dirSet
72.0
CRAP 43.5
« Toader.pm ↑ Summary Toader/Render.pm »
1 package Toader::Gallery;
2  
3 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 4 ▶use base 'Error::Helper';
Subroutine BEGIN: called CC=1 SCAR=0.0
6 4 ▶use Toader::isaToaderDir;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 4 ▶use Config::Tiny;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 =head1 NAME
10  
11 Toader::Gallery - Handle image galleries.
12  
13 =head1 VERSION
14  
15 Version 0.1.0
16  
17 =cut
18  
19 4 our $VERSION = '0.1.0';
20  
21 =head1 METHODS
22  
23 =head2 new
24  
25 This initiates the object.
26  
27 There is one argument is required and this is a
28 L<Toader> object.
29  
30 my $foo = Toader::AutoDoc->new($toader);
31 if ( $foo->error ){
32 warn('error:'.$foo->error.': '.$foo->errorString);
33 }
34  
35 =cut
36  
37 0 ▶sub new{
Subroutine new: not called CC=5 SCAR=34.0
Pod documented
38 0 my $toader=$_[1];
39  
40 0 my $self={
41 error=>undef,
42 errorString=>'',
43 perror=>undef,
44 dir=>undef,
45 errorExtra=>{
46 flags=>{
47 1=>'noDirSpecified',
48 2=>'notAtoaderDir',
49 3=>'readConfigFailed',
50 4=>'noConfig',
51 5=>'nonNumericResolution',
52 6=>'noSrcPath',
53 7=>'noSrcURL',
54 8=>'noOutputPath',
55 9=>'noOutputURL',
56 10=>'dirAlreadyInit',
57 11=>'pathHelperErrored',
58 12=>'notAtoaderObj',
59 13=>'getVCSerrored',
60 14=>'VCSusableErrored',
61 15=>'underVCSerrored',
62 16=>'VCSaddErrored',
63 17=>'VCSdeleteErrored',
64 18=>'noToaderObj',
65 },
66 },
67 VCSusable=>0,
68 };
69 0 bless $self;
70  
71 #if we have a Toader object, reel it in
72 0 ▶ if ( ! defined( $toader ) ){
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $toader) 0 0 0
73 0 $self->{perror}=1;
74 0 $self->{error}=18;
75 0 $self->{errorString}='No Toader object specified';
76 0 $self->warn;
77 0 return $self;
78 }
79 0 ▶ if ( ref( $toader ) ne "Toader" ){
Branch: 1 branch
BranchTrueFalseTotal
if (ref $toader ne "Toader") 0 0 0
80 0 $self->{perror}=1;
81 0 $self->{error}=12;
82 0 $self->{errorString}='The object specified is a "'.ref($toader).'"';
83 0 $self->warn;
84 0 return $self;
85 }
86 0 $self->{toader}=$toader;
87  
88 #gets the Toader::VCS object
89 0 $self->{vcs}=$self->{toader}->getVCS;
90 0 ▶ if ( $toader->error ){
Branch: 1 branch
BranchTrueFalseTotal
if ($toader->error) 0 0 0
91 0 $self->{perror}=1;
92 0 $self->{error}=13;
93 $self->{errorString}='Toader->getVCS errored. error="'.
94 0 $self->{toader}->error.'" errorString="'.$self->{toader}->errorString.'"';
95 0 $self->warn;
96 0 return $self;
97 }
98
99 #checks if VCS is usable
100 0 $self->{VCSusable}=$self->{vcs}->usable;
101 0 ▶ if ( $self->{vcs}->error ){
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"vcs"}->error) 0 0 0
102 0 $self->{perror}=1;
103 0 $self->{error}=14;
104 $self->{errorString}='Toader::VCS->usable errored. error="'.
105 0 $self->{toader}->error.'" errorString="'.$self->{toader}->errorString.'"';
106 0 $self->warn;
107 0 return $self;
108 }
109  
110 0 return $self;
111 }
112  
113 =head2 delConfig
114  
115 This removes a gallery config for a directory.
116  
117 =cut
118  
119 0 ▶sub delConfig{
Subroutine delConfig: not called CC=8 SCAR=42.8
Pod documented
120 0 my $self=$_[0];
121  
122 0 ▶ if (!$self->errorblank){
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->errorblank) 0 0 0
123 0 return undef;
124 }
125  
126 0 ▶ if ( ! defined( $self->{config} ) ){
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->{"config"}) 0 0 0
127 0 $self->{error}=4;
128 0 $self->{errorString}='No config for the current directory';
129 0 $self->warn;
130 0 return undef;
131 }
132  
133 0 my $file=$self->{dir}.'/.toader/gallery.ini';
134 0 ▶ if ( ! unlink( $file ) ){
Branch: 1 branch
BranchTrueFalseTotal
unless (unlink $file) 0 0 0
135 0 $self->{error}=11;
136 0 $self->{errorString}='Failed to write the config out to "'.$file.'"';
137 0 $self->warn;
138 0 return undef;
139 }
140
141 #if VCS is not usable, stop here
142 0 ▶ if ( ! $self->{VCSusable} ){
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->{"VCSusable"}) 0 0 0
143 0 return 1;
144 }
145  
146 #if it is under VCS, we have nothing to do
147 0 my $underVCS=$self->{vcs}->underVCS($file);
148 0 ▶ if ( $self->{vcs}->error ){
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"vcs"}->error) 0 0 0
149 0 $self->{error}=15;
150 $self->{errorString}='Toader::VCS->underVCS errored. error="'.
151 0 $self->{vcs}->error.'" errorString="'.$self->{vcs}->errorString.'"';
152 0 $self->warn;
153 0 return undef;
154 }
155 0 ▶ if ( $underVCS ){
Branch: 1 branch
BranchTrueFalseTotal
if ($underVCS) 0 0 0
156 0 return 1;
157 }
158  
159 #delete it as if we reach here it is not under VCS and VCS is being used
160 0 $self->{vcs}->delete( $file );
161 0 ▶ if ( $self->{vcs}->error ){
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"vcs"}->error) 0 0 0
162 0 $self->{error}=17;
163 $self->{errorString}='Toader::VCS->delete errored. error="'.
164 0 $self->{vcs}->error.'" errorString="'.$self->{vcs}->errorString.'"';
165 0 $self->warn;
166 0 return undef;
167 }
168  
169 0 return 1;
170 }
171  
172 =head2 dirGet
173  
174 This gets L<Toader> directory this entry is associated with.
175  
176 This will only error if a permanent error is set.
177  
178 This will return undef if no directory has been set.
179  
180 my $dir=$foo->dirGet;
181 if($foo->error){
182 warn('Error:'.$foo->error.': '.$foo->errorString);
183 }
184  
185 =cut
186  
187 0 ▶sub dirGet{
Subroutine dirGet: not called CC=2 SCAR=17.9
Pod documented
188 0 my $self=$_[0];
189  
190 0 ▶ if (!$self->errorblank){
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->errorblank) 0 0 0
191 0 return undef;
192 }
193  
194 0 return $self->{dir};
195 }
196  
197 =head2 dirSet
198  
199 This sets L<Toader> directory this entry is associated with.
200  
201 One argument is taken and it is the L<Toader> directory to set it to.
202  
203 my $dir=$foo->dirSet($toaderDirectory);
204 if($foo->error){
205 warn('Error:'.$foo->error.': '.$foo->errorString);
206 }
207  
208 =cut
209  
210 0 ▶sub dirSet{
Subroutine dirSet: not called CC=8 SCAR=42.8
Pod documented
211 0 my $self=$_[0];
212 0 my $dir=$_[1];
213  
214 0 ▶ if (!$self->errorblank){
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->errorblank) 0 0 0
215 0 return undef;
216 }
217  
218 #make sure a directory has been specified
219 0 ▶ if (!defined($dir)) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $dir) 0 0 0
220 0 $self->{error}=1;
221 0 $self->{errorString}='No directory specified.';
222 0 $self->warn;
223 0 return undef;
224 }
225  
226 #cleans up the naming
227 0 my $pathHelper=Toader::pathHelper->new($dir);
228 0 ▶ if ( $pathHelper->error ){
Branch: 1 branch
BranchTrueFalseTotal
if ($pathHelper->error) 0 0 0
229 0 $self->{error}=11;
230 0 $self->{errorString}='Failed to initialize Toader::pathHelper';
231 0 $self->warn;
232 0 return undef;
233 }
234 0 $dir=$pathHelper->cleanup( $dir );
235  
236 #checks if the directory is Toader directory or not
237 0 my $isatd=Toader::isaToaderDir->new;
238 0 my $returned=$isatd->isaToaderDir($dir);
239 0 ▶ if (! $returned ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($returned) 0 0 0
240 0 $self->{error}=2;
241 0 $self->{errorString}='"'.$dir.'" is not a Toader directory.';
242 0 $self->warn;
243 0 return undef;
244 }
245  
246 0 $self->{dir}=$dir;
247  
248 0 ▶ if ( defined( $self->{config} ) ){
Branch: 1 branch
BranchTrueFalseTotal
if (defined $self->{"config"}) 0 0 0
249 0 delete( $self->{config} );
250 }
251
252 0 my $configfile=$self->{dir}.'/.toader/gallery.ini';
253 0 ▶ if ( -f $configfile ){
Branch: 1 branch
BranchTrueFalseTotal
if (-f $configfile) 0 0 0
254 0 $self->{config}=Config::Tiny->read( $configfile );
255 0 ▶ if ( ! defined( $self->{config} ) ){
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->{"config"}) 0 0 0
256 0 $self->{error}=3;
257 0 $self->{errorString}='Failed to read the gallery config, "'.$configfile.'",';
258 0 $self->warn;
259 0 return undef;
260 }
261 }
262  
263 0 return 1;
264 }
265  
266 =head2 init
267  
268 This is initializes the config for a directory. This is automatically
269 called if it has not been done so for a directory.
270  
271 =cut
272  
273 0 ▶sub init{
Subroutine init: not called CC=4 SCAR=30.0
Pod documented
274 0 my $self=$_[0];
275  
276 0 ▶ if (!$self->errorblank){
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->errorblank) 0 0 0
277 0 return undef;
278 }
279
280 0 ▶ if ( defined( $self->{config} ) ){
Branch: 1 branch
BranchTrueFalseTotal
if (defined $self->{"config"}) 0 0 0
281 0 $self->{error}=10;
282 0 $self->{errorString}='"'.$self->{dir}.'" has already been initialized';
283 0 $self->warn;
284 0 return undef;
285 }
286  
287 0 $self->{config}=Config::Tiny->new;
288 0 $self->writeConfig;
289 0 ▶ if ( $self->error ){
Branch: 1 branch
BranchTrueFalseTotal
if ($self->error) 0 0 0
290 0 $self->warnString('Failed to write the config out');
291 0 return undef;
292 }
293  
294 0 return 1;
295 }
296  
297 =head2 outputPathGet
298  
299 This returns the output path.
300  
301 my $outputPath=$foo->outputPathGet;
302 if ( $foo->error ){
303 warn( 'error:'.$foo->error.': '.$foo->errorString );
304 }
305  
306 =cut
307  
308 0 ▶sub outputPathGet{
Subroutine outputPathGet: not called CC=3 SCAR=24.8
Pod documented
309 0 my $self=$_[0];
310  
311 0 ▶ if (!$self->errorblank){
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->errorblank) 0 0 0
312 0 return undef;
313 }
314  
315 0 ▶ if ( ! defined( $self->{config} ) ){
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->{"config"}) 0 0 0
316 0 $self->{error}=4;
317 0 $self->{errorString}='No config for the current directory';
318 0 $self->warn;
319 0 return undef;
320 }
321  
322 0 return $self->{config}->{'_'}->{'outputPath'};
323 }
324  
325 =head2 outputPathSet
326  
327 This returns the output path.
328  
329 $foo->outputPathSet( $outputPath );
330 if ( $foo->error ){
331 warn( 'error:'.$foo->error.': '.$foo->errorString );
332 }
333  
334 =cut
335  
336 0 ▶sub outputPathSet{
Subroutine outputPathSet: not called CC=6 SCAR=37.4
Pod documented
337 0 my $self=$_[0];
338 0 my $outputPath=$_[1];
339  
340 0 ▶ if (!$self->errorblank){
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->errorblank) 0 0 0
341 0 return undef;
342 }
343  
344 0 ▶ if ( ! defined( $self->{config} ) ){
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->{"config"}) 0 0 0
345 0 $self->init;
346 0 ▶ if ( $self->error ){
Branch: 1 branch
BranchTrueFalseTotal
if ($self->error) 0 0 0
347 0 $self->warnString('Failed to initialize the gallery config');
348 0 return undef;
349 }
350 }
351  
352 0 ▶ if ( ! defined( $outputPath ) ){
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $outputPath) 0 0 0
353 0 $self->{error}=8;
354 0 $self->{errorString}='No output path specified';
355 }
356  
357 0 $self->{config}->{'_'}->{'outputPath'}=$outputPath;
358  
359 0 $self->writeConfig;
360 0 ▶ if ( $self->error ){
Branch: 1 branch
BranchTrueFalseTotal
if ($self->error) 0 0 0
361 0 $self->warnString('Failed to write the config out');
362 0 return undef;
363 }
364  
365 0 return 1;
366 }
367  
368 =head2 outputURLget
369  
370 This returns the output path.
371  
372 my $outputURL=$foo->outputURLget;
373 if ( $foo->error ){
374 warn( 'error:'.$foo->error.': '.$foo->errorString );
375 }
376  
377 =cut
378  
379 0 ▶sub outputURLget{
Subroutine outputURLget: not called CC=3 SCAR=24.8
Pod documented
380 0 my $self=$_[0];
381  
382 0 ▶ if (!$self->errorblank){
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->errorblank) 0 0 0
383 0 return undef;
384 }
385  
386 0 ▶ if ( ! defined( $self->{config} ) ){
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->{"config"}) 0 0 0
387 0 $self->{error}=4;
388 0 $self->{errorString}='No config for the current directory';
389 0 $self->warn;
390 0 return undef;
391 }
392  
393 0 return $self->{config}->{'_'}->{'outputURL'};
394 }
395  
396 =head2 outputURLset
397  
398 This sets the output URL.
399  
400 my $outputURL=$foo->outputURLget;
401 if ( $foo->error ){
402 warn( 'error:'.$foo->error.': '.$foo->errorString );
403 }
404  
405 =cut
406  
407 0 ▶sub outputURLset{
Subroutine outputURLset: not called CC=6 SCAR=37.4
Pod documented
408 0 my $self=$_[0];
409 0 my $outputURL=$_[1];
410  
411 0 ▶ if (!$self->errorblank){
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->errorblank) 0 0 0
412 0 return undef;
413 }
414  
415 0 ▶ if ( ! defined( $self->{config} ) ){
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->{"config"}) 0 0 0
416 0 $self->init;
417 0 ▶ if ( $self->error ){
Branch: 1 branch
BranchTrueFalseTotal
if ($self->error) 0 0 0
418 0 $self->warnString('Failed to initialize the gallery config');
419 0 return undef;
420 }
421 }
422  
423 0 ▶ if ( ! defined( $outputURL ) ){
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $outputURL) 0 0 0
424 0 $self->{error}=9;
425 0 $self->{errorString}='No output URL specified';
426 0 $self->warn;
427 0 return undef;
428 }
429  
430 0 $self->{config}->{'_'}->{'outputURL'}=$outputURL;
431  
432 0 $self->writeConfig;
433 0 ▶ if ( $self->error ){
Branch: 1 branch
BranchTrueFalseTotal
if ($self->error) 0 0 0
434 0 $self->warnString('Failed to write the config out');
435 0 return undef;
436 }
437  
438 0 return 1;
439 }
440  
441 =head2 srcPathGet
442  
443 This returns the source path.
444  
445 my $srcPath=$foo->srcPath;
446 if ( $foo->error ){
447 warn('error:'.$foo->error.': '.$foo->errorString);
448 }
449  
450 =cut
451  
452 0 ▶sub srcPathGet{
Subroutine srcPathGet: not called CC=3 SCAR=24.8
Pod documented
453 0 my $self=$_[0];
454  
455 0 ▶ if (!$self->errorblank){
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->errorblank) 0 0 0
456 0 return undef;
457 }
458  
459 0 ▶ if ( ! defined( $self->{config} ) ){
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->{"config"}) 0 0 0
460 0 $self->{error}=4;
461 0 $self->{errorString}='No config for the current directory';
462 0 $self->warn;
463 0 return undef;
464 }
465  
466 0 return $self->{config}->{'_'}->{'srcPath'};
467 }
468  
469 =head2 srcPathSet
470  
471 This sets the that to search for images.
472  
473 One argument is required and it is a path.
474  
475 $foo->srcPathSet( $srcPath );
476 if ( $foo->error ){
477 warn( 'error:'.$foo->error.': '.$foo->errorString );
478 }
479  
480 =cut
481  
482 0 ▶sub srcPathSet{
Subroutine srcPathSet: not called CC=6 SCAR=37.4
Pod documented
483 0 my $self=$_[0];
484 0 my $srcPath=$_[1];
485  
486 0 ▶ if (!$self->errorblank){
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->errorblank) 0 0 0
487 0 return undef;
488 }
489  
490 0 ▶ if ( ! defined( $self->{config} ) ){
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->{"config"}) 0 0 0
491 0 $self->init;
492 0 ▶ if ( $self->error ){
Branch: 1 branch
BranchTrueFalseTotal
if ($self->error) 0 0 0
493 0 $self->warnString('Failed to initialize the gallery config');
494 0 return undef;
495 }
496 }
497  
498 0 ▶ if ( ! defined( $srcPath ) ){
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $srcPath) 0 0 0
499 0 $self->{error}=6;
500 0 $self->{errorString}='No source path specified';
501 }
502  
503 0 $self->{config}->{'_'}->{'srcPath'}=$srcPath;
504  
505 0 $self->writeConfig;
506 0 ▶ if ( $self->error ){
Branch: 1 branch
BranchTrueFalseTotal
if ($self->error) 0 0 0
507 0 $self->warnString('Failed to write the config out');
508 0 return undef;
509 }
510  
511 0 return 1;
512 }
513  
514 =head2 srcURLget
515  
516 This gets the URL to use for the images.
517  
518 my $srcURLget=$foo->srcURLget;
519 if ( $foo->error ){
520 warn('error:'.$foo->error.': '.$foo->errorString);
521 }
522  
523 =cut
524  
525 0 ▶sub srcURLget{
Subroutine srcURLget: not called CC=3 SCAR=24.8
Pod documented
526 0 my $self=$_[0];
527  
528 0 ▶ if (!$self->errorblank){
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->errorblank) 0 0 0
529 0 return undef;
530 }
531  
532 0 ▶ if ( ! defined( $self->{config} ) ){
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->{"config"}) 0 0 0
533 0 $self->{error}=4;
534 0 $self->{errorString}='No config for the current directory';
535 0 $self->warn;
536 0 return undef;
537 }
538  
539 0 return $self->{config}->{'_'}->{'srcURL'};
540 }
541  
542 =head2 srcURLset
543  
544 This sets the URL that is used for linking to the source images.
545  
546 $foo->srcURLset( $url );
547 if ( $foo->error ){
548 warn( 'error:'.$foo->error.': '.$foo->errorString );
549 }
550  
551 =cut
552  
553 0 ▶sub srcURLset{
Subroutine srcURLset: not called CC=6 SCAR=37.4
Pod documented
554 0 my $self=$_[0];
555 0 my $srcURL=$_[1];
556  
557 0 ▶ if (!$self->errorblank){
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->errorblank) 0 0 0
558 0 return undef;
559 }
560  
561 0 ▶ if ( ! defined( $self->{config} ) ){
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->{"config"}) 0 0 0
562 0 $self->init;
563 0 ▶ if ( $self->error ){
Branch: 1 branch
BranchTrueFalseTotal
if ($self->error) 0 0 0
564 0 $self->warnString('Failed to initialize the gallery config');
565 0 return undef;
566 }
567 }
568  
569 0 ▶ if ( ! defined( $srcURL ) ){
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $srcURL) 0 0 0
570 0 $self->{error}=7;
571 0 $self->{errorString}='Nothing specified for the source URL';
572 0 $self->warn;
573 0 return undef;
574 }
575  
576 0 $self->{config}->{'_'}->{'srcURL'}=$srcURL;
577  
578 0 $self->writeConfig;
579 0 ▶ if ( $self->error ){
Branch: 1 branch
BranchTrueFalseTotal
if ($self->error) 0 0 0
580 0 $self->warnString('Failed to write the config out');
581 0 return undef;
582 }
583  
584 0 return 1;
585 }
586  
587 =head2 renderUpdateDetailsGet
588  
589 Returns if upon rendering it should update image details or not.
590  
591 The return value is a Perl boolean.
592  
593 my $update=$foo->renderUpdateDetailsGet;
594 if ( $foo->error ){
595 warn('error:'.$foo->error.': '.$foo->errorString);
596 }
597  
598 =cut
599  
600 0 ▶sub renderUpdateDetailsGet{
Subroutine renderUpdateDetailsGet: not called CC=4 SCAR=30.0
Pod documented
601 0 my $self=$_[0];
602  
603 0 ▶ if (!$self->errorblank){
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->errorblank) 0 0 0
604 0 return undef;
605 }
606  
607 0 ▶ if ( ! defined( $self->{config} ) ){
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->{"config"}) 0 0 0
608 0 $self->{error}=4;
609 0 $self->{errorString}='No config for the current directory';
610 0 $self->warn;
611 0 return undef;
612 }
613  
614 0 ▶ if ( ! defined( $self->{config}->{'_'}->{'renderUpdateDetails'} ) ){
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->{"config"}{"_"}{"renderUpdateDetails"}) 0 0 0
615 0 return 0;
616 }
617  
618 0 return $self->{config}->{'_'}->{'renderUpdateDetails'};
619 }
620  
621 =head2 renderUpdateDetailsSet
622  
623 This sets wether or note Toader::Render::Gallery->render should
624 update the details or not.
625  
626 This takes a Perl boolean.
627  
628 $foo->renderUpdateDetailsGet( $update );
629 if ( $foo->error ){
630 warn('error:'.$foo->error.': '.$foo->errorString);
631 }
632  
633 =cut
634  
635 0 ▶sub renderUpdateDetailsSet{
Subroutine renderUpdateDetailsSet: not called CC=5 SCAR=34.0
Pod documented
636 0 my $self=$_[0];
637 0 my $update=$_[1];
638  
639 0 ▶ if (!$self->errorblank){
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->errorblank) 0 0 0
640 0 return undef;
641 }
642  
643 0 ▶ if ( ! defined( $update ) ){
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $update) 0 0 0
644 0 $update=0;
645 }
646  
647 0 ▶ if ( $update ){
Branch: 1 branch
BranchTrueFalseTotal
if ($update) 0 0 0
648 0 $update=1;
649 }
650  
651 0 ▶ if ( ! defined( $self->{config} ) ){
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->{"config"}) 0 0 0
652 0 $self->{error}=4;
653 0 $self->{errorString}='No config for the current directory';
654 0 $self->warn;
655 0 return undef;
656 }
657  
658 0 $self->{config}->{'_'}->{'renderUpdateDetails'}=$update;
659  
660 0 return 1;
661 }
662  
663 =head2 renderUpdateIndexesGet
664  
665 Returns if upon rendering it should update the indexes or not.
666  
667 The return value is a Perl boolean.
668  
669 my $update=$foo->renderUpdateIndexesGet;
670 if ( $foo->error ){
671 warn('error:'.$foo->error.': '.$foo->errorString);
672 }
673  
674 =cut
675  
676 0 ▶sub renderUpdateIndexesGet{
Subroutine renderUpdateIndexesGet: not called CC=4 SCAR=30.0
Pod documented
677 0 my $self=$_[0];
678  
679 0 ▶ if (!$self->errorblank){
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->errorblank) 0 0 0
680 0 return undef;
681 }
682  
683 0 ▶ if ( ! defined( $self->{config} ) ){
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->{"config"}) 0 0 0
684 0 $self->{error}=4;
685 0 $self->{errorString}='No config for the current directory';
686 0 $self->warn;
687 0 return undef;
688 }
689  
690 0 ▶ if ( ! defined( $self->{config}->{'_'}->{'renderUpdateIndexes'} ) ){
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->{"config"}{"_"}{"renderUpdateIndexes"}) 0 0 0
691 0 return 0;
692 }
693  
694 0 return $self->{config}->{'_'}->{'renderUpdateIndexes'};
695 }
696  
697 =head2 renderUpdateIndexesSet
698  
699 This sets wether or note Toader::Render::Gallery->render should
700 update the indexes or not.
701  
702 This takes a Perl boolean.
703  
704 $foo->renderUpdateIndexesGet( $update );
705 if ( $foo->error ){
706 warn('error:'.$foo->error.': '.$foo->errorString);
707 }
708  
709 =cut
710  
711 0 ▶sub renderUpdateIndexesSet{
Subroutine renderUpdateIndexesSet: not called CC=5 SCAR=34.0
Pod documented
712 0 my $self=$_[0];
713 0 my $update=$_[1];
714  
715 0 ▶ if (!$self->errorblank){
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->errorblank) 0 0 0
716 0 return undef;
717 }
718  
719 0 ▶ if ( ! defined( $update ) ){
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $update) 0 0 0
720 0 $update=0;
721 }
722  
723 0 ▶ if ( $update ){
Branch: 1 branch
BranchTrueFalseTotal
if ($update) 0 0 0
724 0 $update=1;
725 }
726  
727 0 ▶ if ( ! defined( $self->{config} ) ){
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->{"config"}) 0 0 0
728 0 $self->{error}=4;
729 0 $self->{errorString}='No config for the current directory';
730 0 $self->warn;
731 0 return undef;
732 }
733  
734 0 $self->{config}->{'_'}->{'renderUpdateIndexes'}=$update;
735  
736 0 return 1;
737 }
738  
739 =head2 renderUpdateScaledGet
740  
741 Returns if upon rendering it should update the scaled images or not.
742  
743 The return value is a Perl boolean.
744  
745 my $update=$foo->renderUpdateIndexesGet;
746 if ( $foo->error ){
747 warn('error:'.$foo->error.': '.$foo->errorString);
748 }
749  
750 =cut
751  
752 0 ▶sub renderUpdateScaledGet{
Subroutine renderUpdateScaledGet: not called CC=4 SCAR=30.0
Pod documented
753 0 my $self=$_[0];
754  
755 0 ▶ if (!$self->errorblank){
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->errorblank) 0 0 0
756 0 return undef;
757 }
758  
759 0 ▶ if ( ! defined( $self->{config} ) ){
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->{"config"}) 0 0 0
760 0 $self->{error}=4;
761 0 $self->{errorString}='No config for the current directory';
762 0 $self->warn;
763 0 return undef;
764 }
765  
766 0 ▶ if ( ! defined( $self->{config}->{'_'}->{'renderUpdateScaled'} ) ){
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->{"config"}{"_"}{"renderUpdateScaled"}) 0 0 0
767 0 return 0;
768 }
769  
770 0 return $self->{config}->{'_'}->{'renderUpdateScaled'};
771 }
772  
773 =head2 renderUpdateScaledSet
774  
775 This sets wether or note Toader::Render::Gallery->render should
776 update the scaled images or not.
777  
778 This takes a Perl boolean.
779  
780 $foo->renderUpdateIndexesGet( $update );
781 if ( $foo->error ){
782 warn('error:'.$foo->error.': '.$foo->errorString);
783 }
784  
785 =cut
786  
787 0 ▶sub renderUpdateScaledSet{
Subroutine renderUpdateScaledSet: not called CC=5 SCAR=34.0
Pod documented
788 0 my $self=$_[0];
789 0 my $update=$_[1];
790  
791 0 ▶ if (!$self->errorblank){
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->errorblank) 0 0 0
792 0 return undef;
793 }
794  
795 0 ▶ if ( ! defined( $update ) ){
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $update) 0 0 0
796 0 $update=0;
797 }
798  
799 0 ▶ if ( $update ){
Branch: 1 branch
BranchTrueFalseTotal
if ($update) 0 0 0
800 0 $update=1;
801 }
802  
803 0 ▶ if ( ! defined( $self->{config} ) ){
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->{"config"}) 0 0 0
804 0 $self->{error}=4;
805 0 $self->{errorString}='No config for the current directory';
806 0 $self->warn;
807 0 return undef;
808 }
809  
810 0 $self->{config}->{'_'}->{'renderUpdateScaled'}=$update;
811  
812 0 return 1;
813 }
814  
815 =head2 resolutionSmallGet
816  
817 Returns the small resolution.
818  
819 my $smallRes=$foo->resolutionSmallGet;
820 if ( $foo->error ){
821 warn('error:'.$foo->error.': '.$foo->errorString);
822 }
823  
824 =cut
825  
826 0 ▶sub resolutionSmallGet{
Subroutine resolutionSmallGet: not called CC=5 SCAR=34.0
Pod documented
827 0 my $self=$_[0];
828  
829 0 ▶ if (!$self->errorblank){
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->errorblank) 0 0 0
830 0 return undef;
831 }
832  
833 0 ▶ if ( ! defined( $self->{config} ) ){
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->{"config"}) 0 0 0
834 0 $self->{error}=4;
835 0 $self->{errorString}='No config for the current directory';
836 0 $self->warn;
837 0 return undef;
838 }
839  
840 0 ▶ if ( ! defined( $self->{config}->{'_'}->{'smallResolution'} ) ){
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->{"config"}{"_"}{"smallResolution"}) 0 0 0
841 0 return 200;
842 }
843  
844 0 ▶ if ( $self->{config}->{'_'}->{'smallResolution'} !~ /^[0123456789]*$/ ){
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->{"config"}{"_"}{"smallResolution"} =~ /^[0123456789]*$/) 0 0 0
845 0 $self->{error}=5;
846 0 $self->{errorString}='"'.$self->{config}->{'_'}->{'smallResolution'}.'" is not numeric';
847 0 $self->warn;
848 0 return undef;
849 }
850  
851 0 return $self->{config}->{'_'}->{'smallResolution'};
852 }
853  
854 =head2 resolutionSmallSet
855  
856 Sets the small resolution.
857  
858 One argument is taken and that is the maximum resolution for a
859 image. If not specified, it resets it to 200.
860  
861 my $smallRes=$foo->resolutionSmallSet( $resolution );
862 if ( $foo->error ){
863 warn('error:'.$foo->error.': '.$foo->errorString);
864 }
865  
866 =cut
867  
868 0 ▶sub resolutionSmallSet{
Subroutine resolutionSmallSet: not called CC=7 SCAR=40.3
Pod documented
869 0 my $self=$_[0];
870 0 my $res=$_[1];
871  
872 0 ▶ if (!$self->errorblank){
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->errorblank) 0 0 0
873 0 return undef;
874 }
875  
876 0 ▶ if ( ! defined( $self->{config} ) ){
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->{"config"}) 0 0 0
877 0 $self->init;
878 0 ▶ if ( $self->error ){
Branch: 1 branch
BranchTrueFalseTotal
if ($self->error) 0 0 0
879 0 $self->warnString('Failed to initialize the gallery config');
880 0 return undef;
881 }
882 }
883  
884 0 ▶ if ( ! defined( $res ) ){
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $res) 0 0 0
885 0 $res=200;
886 }
887  
888 0 ▶ if ( $self->{config}->{'_'}->{'smallResolution'} !~ /^[0123456789]*$/ ){
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->{"config"}{"_"}{"smallResolution"} =~ /^[0123456789]*$/) 0 0 0
889 0 $self->{error}=5;
890 0 $self->{errorString}='"'.$self->{config}->{'_'}->{'smallResolution'}.'" is not numeric';
891 0 $self->warn;
892 0 return undef;
893 }
894  
895 0 $self->{config}->{'_'}->{'smallResolution'}=$res;
896  
897 0 $self->writeConfig;
898 0 ▶ if ( $self->error ){
Branch: 1 branch
BranchTrueFalseTotal
if ($self->error) 0 0 0
899 0 $self->warnString('Failed to write the config out');
900 0 return undef;
901 }
902  
903 0 return 1;
904 }
905  
906 =head2 resolutionLargeGet
907  
908 Returns the larg resolution.
909  
910 my $largeRes=$foo->resolutionLargeGet;
911 if ( $foo->error ){
912 warn('error:'.$foo->error.': '.$foo->errorString);
913 }
914  
915 =cut
916  
917 0 ▶sub resolutionLargeGet{
Subroutine resolutionLargeGet: not called CC=5 SCAR=34.0
Pod documented
918 0 my $self=$_[0];
919  
920 0 ▶ if (!$self->errorblank){
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->errorblank) 0 0 0
921 0 return undef;
922 }
923  
924 0 ▶ if ( ! defined( $self->{config} ) ){
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->{"config"}) 0 0 0
925 0 $self->{error}=4;
926 0 $self->{errorString}='No config for the current directory';
927 0 $self->warn;
928 0 return undef;
929 }
930  
931 0 ▶ if ( ! defined( $self->{config}->{'_'}->{'smallResolution'} ) ){
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->{"config"}{"_"}{"smallResolution"}) 0 0 0
932 0 return 1024;
933 }
934  
935 0 ▶ if ( $self->{config}->{'_'}->{'smallResolution'} !~ /^[0123456789]*$/ ){
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->{"config"}{"_"}{"smallResolution"} =~ /^[0123456789]*$/) 0 0 0
936 0 $self->{error}=5;
937 0 $self->{errorString}='"'.$self->{config}->{'_'}->{'smallResolution'}.'" is not numeric';
938 0 $self->warn;
939 0 return undef;
940 }
941  
942 0 return $self->{config}->{'_'}->{'smallResolution'};
943 }
944  
945 =head2 resolutionLargeSet
946  
947 Returns the larg resolution.
948  
949 One argument is taken is the maximum resolution to use.
950 If not specified, it resets it to the default, 1024.
951  
952 $foo->resolutionLargeSet( $res );
953 if ( $foo->error ){
954 warn('error:'.$foo->error.': '.$foo->errorString);
955 }
956  
957 =cut
958  
959 0 ▶sub resolutionLargeSet{
Subroutine resolutionLargeSet: not called CC=7 SCAR=40.3
Pod documented
960 0 my $self=$_[0];
961 0 my $res=$_[1];
962  
963 0 ▶ if (!$self->errorblank){
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->errorblank) 0 0 0
964 0 return undef;
965 }
966  
967 0 ▶ if ( ! defined( $self->{config} ) ){
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->{"config"}) 0 0 0
968 0 $self->init;
969 0 ▶ if ( $self->error ){
Branch: 1 branch
BranchTrueFalseTotal
if ($self->error) 0 0 0
970 0 $self->warnString('Failed to initialize the gallery config');
971 0 return undef;
972 }
973 }
974  
975 0 ▶ if ( ! defined( $res ) ){
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $res) 0 0 0
976 0 $res=1024;
977 }
978  
979 0 ▶ if ( $self->{config}->{'_'}->{'smallResolution'} !~ /^[0123456789]*$/ ){
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->{"config"}{"_"}{"smallResolution"} =~ /^[0123456789]*$/) 0 0 0
980 0 $self->{error}=5;
981 0 $self->{errorString}='"'.$self->{config}->{'_'}->{'smallResolution'}.'" is not numeric';
982 0 $self->warn;
983 0 return undef;
984 }
985  
986 0 $self->{config}->{'_'}->{'smallResolution'}=$res;
987  
988 0 $self->writeConfig;
989 0 ▶ if ( $self->error ){
Branch: 1 branch
BranchTrueFalseTotal
if ($self->error) 0 0 0
990 0 $self->warnString('Failed to write the config out');
991 0 return undef;
992 }
993  
994 0 return 1;
995 }
996  
997 =head2 usable
998  
999 This checks if the this object is usable for rendering or not.
1000  
1001 It does not check if the directories exist, other than the settings are
1002 specified.
1003  
1004 if ( ! $foo->usable ){
1005 print "This is not a renderable object currently... something is missing...\n";
1006 }
1007  
1008 =cut
1009  
1010 0 ▶sub usable{
Subroutine usable: not called CC=11 SCAR=48.8
Pod documented
1011 0 my $self=$_[0];
1012  
1013 0 ▶ if (!$self->errorblank){
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->errorblank) 0 0 0
1014 0 return undef;
1015 }
1016  
1017 0 ▶ if ( ! defined( $self->{config} ) ){
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->{"config"}) 0 0 0
1018 0 return undef;
1019 }
1020  
1021 0 ▶ if ( ! defined( $self->{outputPath} ) ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->{"outputPath"}) 0 0 0
1022 0 return undef;
1023 }
1024  
1025 0 ▶ if ( ! defined( $self->{outputURL} ) ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->{"outputURL"}) 0 0 0
1026 0 return undef;
1027 }
1028  
1029 0 ▶ if ( ! defined( $self->{srcPath} ) ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->{"srcPath"}) 0 0 0
1030 0 return undef;
1031 }
1032  
1033 0 ▶ if ( ! defined( $self->{srcURL} ) ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->{"srcURL"}) 0 0 0
1034 0 return undef;
1035 }
1036  
1037 0 ▶ if ( defined( $self->{smallResolution} ) ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $self->{"smallResolution"}) 0 0 0
1038 0 ▶ if ( $self->{smallResolution} !~ /^[0123456789]*/ ){
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->{"smallResolution"} =~ /^[0123456789]*/) 0 0 0
1039 0 return undef;
1040 }
1041 }
1042  
1043 0 ▶ if ( defined( $self->{largeResolution} ) ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $self->{"largeResolution"}) 0 0 0
1044 0 ▶ if ( $self->{largeResolution} !~ /^[0123456789]*/ ){
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->{"largeResolution"} =~ /^[0123456789]*/) 0 0 0
1045 0 return undef;
1046 }
1047 }
1048  
1049 0 return 1;
1050 }
1051  
1052 =head2 writeConfig
1053  
1054 This writes the config out.
1055  
1056 =cut
1057  
1058 0 ▶sub writeConfig{
Subroutine writeConfig: not called CC=8 SCAR=42.8
Pod documented
1059 0 my $self=$_[0];
1060 0 my $res=$_[1];
1061  
1062 0 ▶ if (!$self->errorblank){
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->errorblank) 0 0 0
1063 0 return undef;
1064 }
1065  
1066 0 ▶ if ( ! defined( $self->{config} ) ){
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->{"config"}) 0 0 0
1067 0 $self->{error}=4;
1068 0 $self->{errorString}='No config for the current directory';
1069 0 $self->warn;
1070 0 return undef;
1071 }
1072  
1073 0 my $file=$self->{dir}.'/.toader/gallery.ini';
1074 0 ▶ if ( ! $self->{config}->write( $file ) ){
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->{"config"}->write($file)) 0 0 0
1075 0 $self->{error}=11;
1076 0 $self->{errorString}='Failed to write the config out to "'.$file.'"';
1077 0 $self->warn;
1078 0 return undef;
1079 }
1080  
1081 #if VCS is not usable, stop here
1082 0 ▶ if ( ! $self->{VCSusable} ){
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->{"VCSusable"}) 0 0 0
1083 0 return 1;
1084 }
1085  
1086 #if it is under VCS, we have nothing to do
1087 0 my $underVCS=$self->{vcs}->underVCS($file);
1088 0 ▶ if ( $self->{vcs}->error ){
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"vcs"}->error) 0 0 0
1089 0 $self->{error}=15;
1090 $self->{errorString}='Toader::VCS->underVCS errored. error="'.
1091 0 $self->{vcs}->error.'" errorString="'.$self->{vcs}->errorString.'"';
1092 0 $self->warn;
1093 0 return undef;
1094 }
1095 0 ▶ if ( $underVCS ){
Branch: 1 branch
BranchTrueFalseTotal
if ($underVCS) 0 0 0
1096 0 return 1;
1097 }
1098  
1099 #add it as if we reach here it is not under VCS and VCS is being used
1100 0 $self->{vcs}->add( $file );
1101 0 ▶ if ( $self->{vcs}->error ){
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"vcs"}->error) 0 0 0
1102 0 $self->{error}=16;
1103 $self->{errorString}='Toader::VCS->add errored. error="'.
1104 0 $self->{vcs}->error.'" errorString="'.$self->{vcs}->errorString.'"';
1105 0 $self->warn;
1106 0 return undef;
1107 }
1108  
1109 0 return 1;
1110 }
1111  
1112 =head1 REQUIRED RENDERING METHODS
1113  
1114 The ones listed below are useless and are just included for
1115 compatibility reasons.
1116  
1117 filesDir
1118 renderDir
1119 toDir
1120  
1121 =head2 filesDir
1122  
1123 This returns the file directory for the object.
1124  
1125 This is not a full path, but a partial path that should
1126 be appended the directory current directory being outputted to.
1127  
1128 This returns '' as it is not used by this module. As for rendering,
1129 fullURL is set for L<Toader::Render::General>.
1130  
1131 =cut
1132  
1133 0 ▶sub filesDir{
Subroutine filesDir: not called CC=2 SCAR=17.9
Pod documented
1134 0 my $self=$_[0];
1135  
1136 0 ▶ if (!$self->errorblank){
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->errorblank) 0 0 0
1137 0 return undef;
1138 }
1139  
1140 0 return '';
1141 }
1142  
1143 =head2 locationID
1144  
1145 This returns the location ID.
1146  
1147 This one requires the object to be initialized.
1148  
1149 =cut
1150  
1151 0 ▶sub locationID{
Subroutine locationID: not called CC=2 SCAR=17.9
Pod documented
1152 0 my $self=$_[0];
1153  
1154 0 ▶ if (!$self->errorblank){
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->errorblank) 0 0 0
1155 0 return undef;
1156 }
1157  
1158 0 return 'Gallery';
1159 }
1160  
1161 =head2 renderDir
1162  
1163 This is the directory that it will be rendered to.
1164  
1165 The base directory that will be used for rendering.
1166  
1167 This returns '' as it is not used by this module. As for rendering,
1168 fullURL is set for L<Toader::Render::General>.
1169  
1170 =cut
1171  
1172 0 ▶sub renderDir{
Subroutine renderDir: not called CC=1 SCAR=6.9
Pod documented
1173 0 return '';
1174 }
1175  
1176 =head2 renderUsing
1177  
1178 This returns the module to use for rendering.
1179  
1180 my $module=$foo->renderUsing;
1181  
1182 =cut
1183  
1184 0 ▶sub renderUsing{
Subroutine renderUsing: not called CC=1 SCAR=6.9
Pod documented
1185 0 return 'Toader::Render::Gallery';
1186 }
1187  
1188 =head2 toaderRenderable
1189  
1190 This method returns true and marks it as being L<Toader>
1191 renderable.
1192  
1193 =cut
1194  
1195 0 ▶sub toaderRenderable{
Subroutine toaderRenderable: not called CC=1 SCAR=6.9
Pod documented
1196 0 return 1;
1197 }
1198  
1199 =head2 toDir
1200  
1201 This returns the directory that will return the directory
1202 that contains where this object should be rendered to.
1203  
1204 This is not a full path, but a partial path that should
1205 be appended the directory current directory being outputted to.
1206  
1207 This returns '' as it is not used by this module. As for rendering,
1208 fullURL is set for L<Toader::Render::General>.
1209  
1210 =cut
1211  
1212 0 ▶sub toDir{
Subroutine toDir: not called CC=2 SCAR=17.9
Pod documented
1213 0 my $self=$_[0];
1214  
1215 0 ▶ if (!$self->errorblank){
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->errorblank) 0 0 0
1216 0 return undef;
1217 }
1218  
1219 0 return '';
1220 }
1221  
1222 =head1 ERROR CODES
1223  
1224 =head2 1, noDirSpecified
1225  
1226 No directory specified.
1227  
1228 =head2 2, notAtoaderDir
1229  
1230 The directory is not a Toader directory.
1231  
1232 =head2 3, readConfigFailed
1233  
1234 Failed to read the gallery config.
1235  
1236 =head2 4, noConfig
1237  
1238 No config for this directory.
1239  
1240 =head2 5, nonNumericResolution
1241  
1242 The specified resolution is non-numeric.
1243  
1244 =head2 6, noSrcPath
1245  
1246 No source path specified.
1247  
1248 =head2 7, noSrcURL
1249  
1250 No source URL specified.
1251  
1252 =head2 8, noOutputPath
1253  
1254 No output path specified.
1255  
1256 =head2 9, noOutputURL
1257  
1258 No output URL specified.
1259  
1260 =head2 10, dirAlreadyInit
1261  
1262 The directory has already been initialized.
1263  
1264 =head2 11, pathHelperErrored
1265  
1266 Failed to initialize Toader::pathHelper.
1267  
1268 =head2 12, notAtoaderObj
1269  
1270 Not a Toader object.
1271  
1272 =head2 13, getVCSerrored
1273  
1274 L<Toader>->getVCS errored.
1275  
1276 =head2 14, VCSusableErrored
1277  
1278 L<Toader::VCS>->usable errored.
1279  
1280 =head2 15, underVCSerrored
1281  
1282 L<Toader::VCS>->underVCS errored.
1283  
1284 =head2 16, VCSaddErrored
1285  
1286 L<Toader::VCS>->add errored.
1287  
1288 =head2 17, VCSdeleteErrored
1289  
1290 L<Toader::VCS>->delete errored.
1291  
1292 =head2 18, noToaderObj
1293  
1294 Nothing passed for a L<Toader> object.
1295  
1296 =head1 AUTHOR
1297  
1298 Zane C. Bowers-Hadley, C<< <vvelox at vvelox.net> >>
1299  
1300 =head1 BUGS
1301  
1302 Please report any bugs or feature requests to C<bug-toader at rt.cpan.org>, or through
1303 the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Toader>. I will be notified, and then you'll
1304 automatically be notified of progress on your bug as I make changes.
1305  
1306 =head1 SUPPORT
1307  
1308 You can find documentation for this module with the perldoc command.
1309  
1310 perldoc Toader::AutoDoc
1311  
1312  
1313 You can also look for information at:
1314  
1315 =over 4
1316  
1317 =item * RT: CPAN's request tracker
1318  
1319 L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Toader>
1320  
1321 =item * AnnoCPAN: Annotated CPAN documentation
1322  
1323 L<http://annocpan.org/dist/Toader>
1324  
1325 =item * CPAN Ratings
1326  
1327 L<http://cpanratings.perl.org/d/Toader>
1328  
1329 =item * Search CPAN
1330  
1331 L<http://search.cpan.org/dist/Toader/>
1332  
1333 =back
1334  
1335  
1336 =head1 ACKNOWLEDGEMENTS
1337  
1338  
1339 =head1 LICENSE AND COPYRIGHT
1340  
1341 Copyright 2011 Zane C. Bowers-Hadley.
1342  
1343 This program is free software; you can redistribute it and/or modify it
1344 under the terms of either: the GNU General Public License as published
1345 by the Free Software Foundation; or the Artistic License.
1346  
1347 See http://dev.perl.org/licenses/ for more information.
1348  
1349  
1350 =cut
1351  
1352 4 1; # End of Toader::Gallery
« Toader.pm ↑ Summary Toader/Render.pm »