Skip to content

Commit

Permalink
released version 7.55
Browse files Browse the repository at this point in the history
  • Loading branch information
Al Newkirk committed Jun 14, 2012
1 parent ac5f165 commit 224ccc2
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 12 deletions.
3 changes: 3 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
This file documents the revision history for the Perl library Validation::Class.

7.55 (2012-06-14)
* fixed major bug cause by 7.50 (alternate syntax for the set/load keyword)

7.50 (2012-06-13)
* wrote tests to test the Validation::Class::Field object accessors
* changed module::find usage - no longer loads unless used
Expand Down
2 changes: 1 addition & 1 deletion Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ my %WriteMakefileArgs = (
"Module::Find" => 0,
"utf8" => 0
},
"VERSION" => "7.51",
"VERSION" => "7.55",
"test" => {
"TESTS" => "t/*.t t/regression/*.t t/regression/filters/*.t t/regression/validators/*.t"
}
Expand Down
2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ NAME
Framework

VERSION
version 7.51
version 7.55

SYNOPSIS
package MyVal::User;
Expand Down
2 changes: 1 addition & 1 deletion README.mkdn
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Validation::Class - Self-Validating Object System and Data Validation Framework

# VERSION

version 7.51
version 7.55

# SYNOPSIS

Expand Down
2 changes: 1 addition & 1 deletion dist.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ author = Al Newkirk <anewkirk@ana.io>
license = Perl_5
copyright_holder = Al Newkirk
copyright_year = 2011
version = 7.51
version = 7.55

[MetaResources]
homepage = https://github.com/alnewkirk/Validation-Class
Expand Down
7 changes: 2 additions & 5 deletions lib/Validation/Class.pm
Original file line number Diff line number Diff line change
Expand Up @@ -726,14 +726,11 @@ executing load/set commands, the syntax is as follows:
sub set { goto &load }
sub load {

# check for alternate usages

my $data = pop @_;
my $self = pop @_;
my $data = @_ % 2 ? $_[0] || {} : {@_};

return configure_class_proto sub {

my $proto = $self ? $self->proto : $_[0];
my ($proto) = @_;

my $name = $proto->{package};

Expand Down
42 changes: 42 additions & 0 deletions t/03-keyword-load.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
BEGIN {

use FindBin;
use lib $FindBin::Bin . "/myapp/lib";

}

use utf8;
use Test::More;

{

# github issue 20
# https://github.com/alnewkirk/Validation-Class/issues/20
# test that the Validation::Class::Field object has the desired accessors

package MyApp;

use Validation::Class;

set classes => 1;

fld name => {

required => 1

};

package main;

my $class = "MyApp";
my $self = $class->new(name => "don johnson");

ok $class eq ref $self, "$class instantiated";

my $test = $self->class(name => 'test');

ok "MyApp::Test" eq ref $test, ref($test) . " instantiated";

}

done_testing;
3 changes: 0 additions & 3 deletions t/myapp/lib/MyApp/Introspect.pm
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package MyApp::Introspect;

use Validation::Class;
set {
classes => ['MyApp'] # load MyApp and all MyApp::* child classes
};

sub per_class {

Expand Down

0 comments on commit 224ccc2

Please sign in to comment.