X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FOptional%2FDependencies.pm;h=c1a4fe46b296fdce801e71c8c1df4630ac5cd227;hb=e666c5fd810f9103a8e2ae1994e45828169e703d;hp=68707142f696104ea4954fcabdbe6723f51883a1;hpb=6a5b809ee59551d3362f03af7762e11456420c8e;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Optional/Dependencies.pm b/lib/DBIx/Class/Optional/Dependencies.pm index 6870714..c1a4fe4 100644 --- a/lib/DBIx/Class/Optional/Dependencies.pm +++ b/lib/DBIx/Class/Optional/Dependencies.pm @@ -20,8 +20,8 @@ my $admin_basic = { %$moose_basic, 'MooseX::Types::Path::Class' => '0.05', 'MooseX::Types::JSON' => '0.02', + 'JSON::Any' => '1.22', 'namespace::autoclean' => '0.09', - 'parent' => '0.223', }; my $reqs = { @@ -33,7 +33,7 @@ my $reqs = { req => { %$moose_basic, 'namespace::clean' => '0.11', - 'Hash::Merge' => '0.11', + 'Hash::Merge' => '0.12', }, pod => { title => 'Storage::Replicated', @@ -56,7 +56,6 @@ my $reqs = { %$moose_basic, %$admin_basic, 'Getopt::Long::Descriptive' => '0.081', - 'JSON::Any' => '1.22', 'Text::CSV' => '1.16', }, pod => { @@ -152,7 +151,7 @@ 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, ) : () @@ -247,11 +246,15 @@ 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", ######################################################################### @@ -264,7 +267,30 @@ sub _gen_pod { # 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 @@ -273,7 +299,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', @@ -311,17 +338,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',