From: Peter Rabbitson Date: Mon, 15 Feb 2010 09:28:22 +0000 (+0000) Subject: Final POD touches X-Git-Tag: v0.08119~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits%2FDBIx-Class.git;a=commitdiff_plain;h=7e3dc46f39301189250953880d568cebdc914a77 Final POD touches --- diff --git a/lib/DBIx/Class/Optional/Dependencies.pm b/lib/DBIx/Class/Optional/Dependencies.pm index 780f6c3..5d882e2 100644 --- a/lib/DBIx/Class/Optional/Dependencies.pm +++ b/lib/DBIx/Class/Optional/Dependencies.pm @@ -246,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", ######################################################################### @@ -263,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 @@ -272,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', @@ -310,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',