X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FOptional%2FDependencies.pm;h=6bba18b155e5022be5807a449aecd09da9722a95;hb=270edb2b23987c2b8c7522b402a0d72627cea119;hp=810d8758ed9d3da9713e8e9c593a98faa19e56d2;hpb=0d4740b34575fedb937a31d0189187f126f663f0;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Optional/Dependencies.pm b/lib/DBIx/Class/Optional/Dependencies.pm index 810d875..6bba18b 100644 --- a/lib/DBIx/Class/Optional/Dependencies.pm +++ b/lib/DBIx/Class/Optional/Dependencies.pm @@ -11,6 +11,19 @@ use Carp; # POD is generated automatically by calling _gen_pod from the # Makefile.PL in $AUTHOR mode +my $moose_basic = { + 'Moose' => '0.98', + 'MooseX::Types' => '0.21', +}; + +my $admin_basic = { + %$moose_basic, + 'MooseX::Types::Path::Class' => '0.05', + 'MooseX::Types::JSON' => '0.02', + 'JSON::Any' => '1.22', + 'namespace::autoclean' => '0.09', +}; + my $reqs = { dist => { #'Module::Install::Pod::Inherit' => '0.01', @@ -18,10 +31,9 @@ my $reqs = { replicated => { req => { - 'Moose' => '0.98', - 'MooseX::Types' => '0.21', + %$moose_basic, 'namespace::clean' => '0.11', - 'Hash::Merge' => '0.11', + 'Hash::Merge' => '0.12', }, pod => { title => 'Storage::Replicated', @@ -30,11 +42,31 @@ my $reqs = { }, admin => { + req => { + %$admin_basic, + }, + pod => { + title => 'DBIx::Class::Admin', + desc => 'Modules required for the DBIx::Class administrative library', + }, + }, + + admin_script => { + req => { + %$moose_basic, + %$admin_basic, + 'Getopt::Long::Descriptive' => '0.081', + 'Text::CSV' => '1.16', + }, + pod => { + title => 'dbicadmin', + desc => 'Modules required for the CLI DBIx::Class interface dbicadmin', + }, }, deploy => { req => { - 'SQL::Translator' => '0.11002', + 'SQL::Translator' => '0.11005', }, pod => { title => 'Storage::DBI::deploy()', @@ -42,28 +74,55 @@ my $reqs = { }, }, - author => { + + test_pod => { + req => { + 'Test::Pod' => '1.41', + }, + }, + + test_podcoverage => { req => { - 'Test::Pod' => '1.26', 'Test::Pod::Coverage' => '1.08', 'Pod::Coverage' => '0.20', + }, + }, + + test_notabs => { + req => { #'Test::NoTabs' => '0.9', + }, + }, + + test_eol => { + req => { #'Test::EOL' => '0.6', }, }, - core => { + test_cycle => { req => { - # t/52cycle.t 'Test::Memory::Cycle' => '0', 'Devel::Cycle' => '1.10', + }, + }, + test_dtrelated => { + req => { # t/36datetime.t # t/60core.t 'DateTime::Format::SQLite' => '0', # t/96_is_deteministic_value.t 'DateTime::Format::Strptime'=> '0', + + # t/inflate/datetime_mysql.t + # (doesn't need Mysql itself) + 'DateTime::Format::MySQL' => '0', + + # t/inflate/datetime_pg.t + # (doesn't need PG itself) + 'DateTime::Format::Pg' => '0', }, }, @@ -84,7 +143,6 @@ my $reqs = { ? ( 'Sys::SigAction' => '0', 'DBD::Pg' => '2.009002', - 'DateTime::Format::Pg' => '0', ) : () }, }, @@ -93,7 +151,6 @@ my $reqs = { req => { $ENV{DBICTEST_MYSQL_DSN} ? ( - 'DateTime::Format::MySQL' => '0', 'DBD::mysql' => '0', ) : () }, @@ -119,12 +176,22 @@ my $reqs = { rdbms_asa => { req => { - grep $_, @ENV{qw/DBICTEST_SYBASE_ASA_DSN DBICTEST_SYBASE_ASA_ODBC_DSN/} + (scalar grep $_, @ENV{qw/DBICTEST_SYBASE_ASA_DSN DBICTEST_SYBASE_ASA_ODBC_DSN/}) ? ( 'DateTime::Format::Strptime' => 0, ) : () }, }, + + rdbms_db2 => { + req => { + $ENV{DBICTEST_DB2_DSN} + ? ( + 'DBD::DB2' => 0, + ) : () + }, + }, + }; @@ -214,12 +281,51 @@ sub _check_deps { } } +# This is to be called by the author onbly (automatically in Makefile.PL) sub _gen_pod { my $class = shift; + my $modfn = __PACKAGE__ . '.pm'; + $modfn =~ s/\:\:/\//g; + + require DBIx::Class; + my $distver = DBIx::Class->VERSION; my @chunks = ( + <<"EOC", +######################################################################### +##################### A U T O G E N E R A T E D ######################## +######################################################################### +# +# The contents of this POD file are auto-generated. Any changes you make +# will be lost. If you need to change the generated text edit _gen_pod() +# at the end of $modfn +# +EOC '=head1 NAME', - "$class - Optional module dependency specifications", + "$class - Optional module dependency specifications (for module authors)", + '=head1 SYNOPSIS (EXPERIMENTAL)', + < + +Somewhere in your build-file (e.g. L's Makefile.PL): + + ... + + configure_requires 'DBIx::Class' => '$distver'; + + require $class; + + my \$deploy_deps = $class->req_list_for ('deploy'); + + for (keys %\$deploy_deps) { + requires \$_ => \$deploy_deps->{\$_}; + } + + ... + +Note that there are some caveats regarding C, more info +can be found at L +EOS '=head1 DESCRIPTION', <<'EOD', Some of the less-frequently used features of L have external @@ -228,7 +334,8 @@ with modules he will never use, these optional dependencies are not included in the base Makefile.PL. Instead an exception with a descriptive message is thrown when a specific feature is missing one or several modules required for its operation. This module is the central holding place for the current list -of such dependencies. +of such dependencies, for DBIx::Class core authors, and DBIx::Class extension +authors alike. EOD '=head1 CURRENT REQUIREMENT GROUPS', <<'EOD', @@ -266,17 +373,9 @@ EOD '=back', <, you can do the following in your -C or C - - require $class; - my \$dep_list = $class->req_list_for ('deploy'); - -Which will give you a list of module/version pairs necessary for the particular -feature to function with this version of DBIx::Class. +version of modules a specific feature requires in the B version of +DBIx::Class. See the L for a real-world +example. EOD '=head2 req_ok_for', @@ -284,7 +383,7 @@ EOD '=item Arguments: $group_name', '=item Returns: 1|0', '=back', - 'Returns true or false depending on whether all modules required by $group_name are present on the system and loadable', + 'Returns true or false depending on whether all modules required by C<$group_name> are present on the system and loadable', '=head2 req_missing_for', '=over', @@ -315,7 +414,10 @@ EOD Returns a hashref containing the actual errors that occured while attempting to load each module in the requirement group. EOD - + '=head1 AUTHOR', + 'See L.', + '=head1 LICENSE', + 'You may distribute this code under the same terms as Perl itself', ); my $fn = __FILE__;