mirror of
https://codeberg.org/scip/Data-Validate-Struct.git
synced 2025-12-16 20:21:02 +01:00
fixed cached errors bug
This commit is contained in:
10
Changelog
10
Changelog
@@ -1,7 +1,13 @@
|
||||
NEXT
|
||||
0.9
|
||||
o Added AUTHOR, LICENSE and ABSTRACT fields to Makefile.PL
|
||||
|
||||
o Fixed 'Artistic' typo in Makefile.PL
|
||||
|
||||
o fixed cached errors bug - if a validator object has
|
||||
been used multiple times and if during the first
|
||||
run some errors occured, subsequent runs would show
|
||||
the same error again and again.
|
||||
|
||||
0.08
|
||||
o applied patches by Per Carlson:
|
||||
- don't die on 1st error, rather collect them and
|
||||
@@ -39,7 +45,7 @@ NEXT
|
||||
o well, against renamed it to Data::Validate::Struct,
|
||||
because Data::Validate already exists.
|
||||
|
||||
o removed chack for 'resolvablehost' because some cpantesters
|
||||
o removed check for 'resolvablehost' because some cpantesters
|
||||
failed to run it.
|
||||
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ use File::stat;
|
||||
use Data::Validate qw(:math is_printable);
|
||||
use Data::Validate::IP qw(is_ipv4 is_ipv6);
|
||||
|
||||
our $VERSION = 0.08;
|
||||
our $VERSION = 0.09;
|
||||
|
||||
use vars qw(@ISA);
|
||||
|
||||
@@ -128,7 +128,6 @@ sub new {
|
||||
# types from here and use Data::Validate's methods as subroutine
|
||||
# checks, which we already support.
|
||||
$self->{types} = \%__ValidatorTypes;
|
||||
|
||||
$self->{debug} = 0;
|
||||
$self->{errors} = [];
|
||||
|
||||
@@ -175,6 +174,9 @@ sub type {
|
||||
sub validate {
|
||||
my ($self, $config) = @_;
|
||||
|
||||
# reset errors in case it's a repeated run
|
||||
$self->{errors} = [];
|
||||
|
||||
$self->_traverse($self->{structure}, $config, ());
|
||||
# return TRUE if no errors
|
||||
return scalar @{ $self->{errors} } == 0;
|
||||
@@ -884,7 +886,7 @@ Thanks to David Cantrell for his helpful hints.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
0.08
|
||||
0.09
|
||||
|
||||
=cut
|
||||
|
||||
|
||||
Reference in New Issue
Block a user