r1280@llin: dpavlin | 2007-05-28 00:24:21 +0200
[webpac2] / lib / WebPAC / Validate.pm
index 1856b1f..3c0f65b 100644 (file)
@@ -188,6 +188,7 @@ sub read_validate_delimiters_file {
        } else {
                $log->warn("delimiters path $path doesn't exist, it will be created after this run");
        }
+       $self->{delimiters_path} = $path;
 }
 
 =head2 validate_rec
@@ -372,7 +373,7 @@ sub reset {
                                $self->{_delimiters_templates}->{$f}->{$t};
                }
        }
-       $log->debug("_accumulated_delimiters_templates = ", sub { dump( $self->{_accumulated_delimiter_templates} ) } );
+       $log->debug("_accumulated_delimiters_templates = ", sub { dump( $self->{_accumulated_delimiters_templates} ) } );
        delete ($self->{_delimiters_templates});
 }
 
@@ -566,18 +567,20 @@ Save accumulated delimiter templates
 sub save_delimiters_templates {
        my $self = shift;
 
-       my $path = $self->{delimiters_path};
-
-       return unless ( $path );
+       my $path = shift;
+       $path ||= $self->{delimiters_path};
 
        my $log = $self->_get_logger;
 
+       $log->logdie("need path") unless ( $path );
+
+
        if ( ! $self->{_accumulated_delimiters_templates} ) {
                $log->error('no _accumulated_delimiters_templates found, reset');
                $self->reset;
        }
 
-       if ( $self->{_delimiters_templates} ) {
+       if ( $self->{_delimiters_templates} ) {
                $log->error('found _delimiters_templates, calling reset');
                $self->reset;
        }