From: Dan Kubb Date: Sat, 13 Aug 2005 04:26:23 +0000 (+0000) Subject: Initial insert of the DBIx::Class::Field sub-project into branch "DBIx-Class-Field... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fd0771a16c86033cf974630c884de4c70a5d2263;p=dbsrgits%2FDBIx-Class-Historic.git Initial insert of the DBIx::Class::Field sub-project into branch "DBIx-Class-Field-integration" --- diff --git a/Build.PL b/Build.PL index 651a9d7..a3b570b 100644 --- a/Build.PL +++ b/Build.PL @@ -1,26 +1,70 @@ use strict; +use warnings FATAL => 'all'; use Module::Build; my %arguments = ( - create_makefile_pl => 'passthrough', license => 'perl', module_name => 'DBIx::Class', + build_requires => { + 'File::Spec' => '3.01', + 'Test::Exception' => '0.21', + 'Test::NoWarnings' => '0.08', + 'Test::Manifest' => '1.11', + 'Test::More' => '0.60', + }, requires => { 'Data::Page' => 0, 'DBI' => 0, 'UNIVERSAL::require' => 0, 'NEXT' => 0, - 'Scalar::Util' => 0, 'SQL::Abstract' => 1.20, 'SQL::Abstract::Limit' => 0.101, + 'Scalar::Util' => 1.14, 'DBD::SQLite' => 1.08, 'Tie::IxHash' => 0, 'Storable' => 0, + 'Carp' => '1.03', + 'Class::Std' => '0.0.4', + 'List::MoreUtils' => '0.10', + 'base' => '2.060', + 'strict' => '1.030', + 'version' => '0.420', + 'warnings' => '1.03', }, create_makefile_pl => 'passthrough', create_readme => 1, - test_files => [ glob('t/*.t'), glob('t/*/*.t') ] + add_to_cleanup => [ qw( MANIFEST.bak cover_db .DS_Store Makefile t/var ) ], ); -Module::Build->new(%arguments)->create_build_script; +my $build_class = test_manifest_subclass(); +my $build = $build_class->new(%arguments)->create_build_script(); + +# use Test::Manifest to prioritize test cases +# rather than a naming convention +sub test_manifest_subclass { + return Module::Build->subclass( + class => 'Module::Build::Test::Manifest', + code => q{ + sub ACTION_test { + my ($self, @args ) = @_; + + if( exists $self->{properties}{test_files} ) { + return $self->SUPER::ACTION_test(@args); + } + + local $^X = $self->{config}{perlpath}; + + require Test::Manifest; + require File::Spec; + + Test::Manifest::run_t_manifest( + $self->{properties}{verbose} || 0, + File::Spec->catdir(qw(blib lib)), + File::Spec->catdir(qw(blib arch)), + ); + return; + } + }, + ); +} diff --git a/MANIFEST b/MANIFEST index be95530..08bc181 100644 --- a/MANIFEST +++ b/MANIFEST @@ -31,6 +31,14 @@ lib/DBIx/Class/Core.pm lib/DBIx/Class/Cursor.pm lib/DBIx/Class/DB.pm lib/DBIx/Class/Exception.pm +lib/DBIx/Class/Field.pm +lib/DBIx/Class/Field/Singleton.pm +lib/DBIx/Class/Field/Type/auto_increment.pm +lib/DBIx/Class/Field/Type/column.pm +lib/DBIx/Class/Field/Type/identifier.pm +lib/DBIx/Class/Field/Type/number.pm +lib/DBIx/Class/Field/Type/object.pm +lib/DBIx/Class/Field/Type/string.pm lib/DBIx/Class/InflateColumn.pm lib/DBIx/Class/PK.pm lib/DBIx/Class/PK/Auto.pm @@ -51,7 +59,13 @@ lib/DBIx/Class/Storage/DBI.pm lib/DBIx/Class/Storage/DBI/Cursor.pm lib/DBIx/Class/Table.pm lib/DBIx/Class/Test/SQLite.pm +lib/DBIx/Class/Validation.pm +lib/DBIx/Class/Validation/Type/column.pm +lib/DBIx/Class/Validation/Type/number.pm +lib/DBIx/Class/Validation/Type/object.pm +lib/DBIx/Class/Validation/Type/string.pm MANIFEST This list of files +META.yml script/nextalyzer.pl t/01core.t t/02pod.t @@ -87,6 +101,23 @@ t/cdbi-t/19-set_sql.t t/cdbi-t/21-iterator.t t/cdbi-t/30-pager.t t/cdbi-t/98-failure.t +t/DBIx/Class/Field/basic.t +t/DBIx/Class/Field/Singleton/basic.t +t/DBIx/Class/Field/Type/auto_increment/basic.t +t/DBIx/Class/Field/Type/column/basic.t +t/DBIx/Class/Field/Type/identifier/basic.t +t/DBIx/Class/Field/Type/number/basic.t +t/DBIx/Class/Field/Type/number/validate.t +t/DBIx/Class/Field/Type/object/basic.t +t/DBIx/Class/Field/Type/object/validate.t +t/DBIx/Class/Field/Type/string/basic.t +t/DBIx/Class/Field/Type/string/validate.t +t/DBIx/Class/Field/validate.t +t/DBIx/Class/Validation/basic.t +t/DBIx/Class/Validation/Type/column/basic.t +t/DBIx/Class/Validation/Type/number/basic.t +t/DBIx/Class/Validation/Type/object/basic.t +t/DBIx/Class/Validation/Type/string/basic.t t/lib/DBICTest.pm t/lib/DBICTest/Schema.pm t/lib/DBICTest/Schema/Artist.pm @@ -97,6 +128,7 @@ t/lib/DBICTest/Schema/OneKey.pm t/lib/DBICTest/Schema/Tag.pm t/lib/DBICTest/Schema/Track.pm t/lib/DBICTest/Schema/TwoKeys.pm +t/test_manifest t/testlib/Actor.pm t/testlib/Binary.pm t/testlib/Blurb.pm @@ -114,6 +146,3 @@ t/testlib/MyStarLinkMCPK.pm t/testlib/Order.pm t/testlib/OtherFilm.pm t/testlib/PgBase.pm -META.yml -Makefile.PL -README diff --git a/MANIFEST.SKIP b/MANIFEST.SKIP index 4d0c740..d40f153 100644 --- a/MANIFEST.SKIP +++ b/MANIFEST.SKIP @@ -21,9 +21,11 @@ \.tmp$ \.old$ \.bak$ +\.swp$ \#$ \b\.# +\bTEST$ +\.DS_Store$ # Don't ship the test db ^t/var - diff --git a/lib/DBIx/Class/Field.pm b/lib/DBIx/Class/Field.pm new file mode 100644 index 0000000..ac4ae49 --- /dev/null +++ b/lib/DBIx/Class/Field.pm @@ -0,0 +1,171 @@ +package DBIx::Class::Field; + +# TODO: add a validate_is_read_only method that checks +# the value with Scalar::Util::readonly OR +# checks to see if it's tied into a Readonly class + +# TODO: add a routine that checks to see if the value can +# be tainted or not. Default the taint attribute +# to allow tainting in all values. is_taintable + +use version; our $VERSION = qv('0.2.0'); + +use strict; +use warnings FATAL => 'all'; +use Carp qw( croak ); +use List::MoreUtils qw( any none ); +use Class::Std; +{ + my %name_of : ATTR( :init_arg :get ); + my %label_of : ATTR( :init_arg