Move generated POD to its own dir
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Optional / Dependencies.pm
CommitLineData
8057ed01 1package DBIx::Class::Optional::Dependencies;
2
3use warnings;
4use strict;
5
9c1700e3 6use Carp ();
fb39747c 7
8# NO EXTERNAL NON-5.8.1 CORE DEPENDENCIES EVER (e.g. C::A::G)
8057ed01 9# This module is to be loaded by Makefile.PM on a pristine system
10
f6b26571 11# POD is generated automatically by calling _gen_pod from the
12# Makefile.PL in $AUTHOR mode
13
2a2a7b23 14my $json_any = {
15 'JSON::Any' => '1.22',
16};
17
2b48ebff 18my $moose_basic = {
68de9438 19 'Moose' => '0.98',
20 'MooseX::Types' => '0.21',
21};
22
23my $replicated = {
24 %$moose_basic,
2b48ebff 25};
26
ebcd0e4f 27my $admin_basic = {
28 %$moose_basic,
2a2a7b23 29 %$json_any,
68de9438 30 'MooseX::Types::Path::Class' => '0.05',
31 'MooseX::Types::JSON' => '0.02',
68de9438 32 'namespace::autoclean' => '0.09',
33};
34
a0361822 35my $admin_script = {
36 %$moose_basic,
37 %$admin_basic,
38 'Getopt::Long::Descriptive' => '0.081',
39 'Text::CSV' => '1.16',
40};
41
68de9438 42my $datetime_basic = {
43 'DateTime' => '0.55',
44 'DateTime::Format::Strptime' => '1.2',
ebcd0e4f 45};
46
c7d50a7d 47my $id_shortener = {
26022fb5 48 'Math::BigInt' => '1.80',
c7d50a7d 49 'Math::Base36' => '0.07',
50};
51
be68095d 52my $rdbms_sqlite = {
53 'DBD::SQLite' => '0',
54};
55my $rdbms_pg = {
56 'DBD::Pg' => '0',
57};
58my $rdbms_mssql_odbc = {
59 'DBD::ODBC' => '0',
60};
61my $rdbms_mssql_sybase = {
62 'DBD::Sybase' => '0',
63};
56dca25f 64my $rdbms_mssql_ado = {
65 'DBD::ADO' => '0',
66};
726c8f65 67my $rdbms_msaccess_odbc = {
68 'DBD::ODBC' => '0',
69};
70my $rdbms_msaccess_ado = {
71 'DBD::ADO' => '0',
72};
be68095d 73my $rdbms_mysql = {
74 'DBD::mysql' => '0',
75};
76my $rdbms_oracle = {
77 'DBD::Oracle' => '0',
78 %$id_shortener,
79};
80my $rdbms_ase = {
81 'DBD::Sybase' => '0',
82};
83my $rdbms_db2 = {
84 'DBD::DB2' => '0',
85};
199fbc45 86my $rdbms_db2_400 = {
87 'DBD::ODBC' => '0',
88};
89my $rdbms_informix = {
90 'DBD::Informix' => '0',
91};
92my $rdbms_sqlanywhere = {
93 'DBD::SQLAnywhere' => '0',
94};
95my $rdbms_sqlanywhere_odbc = {
96 'DBD::ODBC' => '0',
97};
98my $rdbms_firebird = {
99 'DBD::Firebird' => '0',
100};
101my $rdbms_firebird_interbase = {
102 'DBD::InterBase' => '0',
103};
e02b39b4 104my $rdbms_firebird_odbc = {
105 'DBD::ODBC' => '0',
106};
be68095d 107
8057ed01 108my $reqs = {
109 dist => {
110 #'Module::Install::Pod::Inherit' => '0.01',
111 },
112
113 replicated => {
68de9438 114 req => $replicated,
f6b26571 115 pod => {
116 title => 'Storage::Replicated',
117 desc => 'Modules required for L<DBIx::Class::Storage::DBI::Replicated>',
118 },
8057ed01 119 },
120
68de9438 121 test_replicated => {
122 req => {
123 %$replicated,
124 'Test::Moose' => '0',
125 },
126 },
127
128
8057ed01 129 admin => {
2b48ebff 130 req => {
ebcd0e4f 131 %$admin_basic,
132 },
133 pod => {
134 title => 'DBIx::Class::Admin',
135 desc => 'Modules required for the DBIx::Class administrative library',
136 },
137 },
138
a4a02f15 139 admin_script => {
ebcd0e4f 140 req => {
a0361822 141 %$admin_script,
2b48ebff 142 },
e144415f 143 pod => {
144 title => 'dbicadmin',
145 desc => 'Modules required for the CLI DBIx::Class interface dbicadmin',
146 },
8057ed01 147 },
148
a0361822 149 test_admin_script => {
150 req => {
151 %$admin_script,
152 ($^O eq 'MSWin32' ? ('Win32::ShellQuote' => 0) : ()),
153 }
154 },
155
8057ed01 156 deploy => {
f6b26571 157 req => {
9e34d554 158 'SQL::Translator' => '0.11006',
f6b26571 159 },
160 pod => {
161 title => 'Storage::DBI::deploy()',
c7d50a7d 162 desc => 'Modules required for L<DBIx::Class::Storage::DBI/deploy> and L<DBIx::Class::Storage::DBI/deployment_statements>',
f6b26571 163 },
8057ed01 164 },
165
c7d50a7d 166 id_shortener => {
167 req => $id_shortener,
168 },
169
0d374214 170 test_component_accessor => {
171 req => {
172 'Class::Unload' => '0.07',
173 },
174 },
175
a109c954 176 test_pod => {
f6b26571 177 req => {
14d17d71 178 'Test::Pod' => '1.41',
a109c954 179 },
180 },
181
182 test_podcoverage => {
183 req => {
f6b26571 184 'Test::Pod::Coverage' => '1.08',
185 'Pod::Coverage' => '0.20',
a109c954 186 },
187 },
188
189 test_notabs => {
190 req => {
d146b340 191 'Test::NoTabs' => '0.9',
a109c954 192 },
193 },
194
195 test_eol => {
196 req => {
8273e845 197 'Test::EOL' => '1.0',
f6b26571 198 },
8057ed01 199 },
200
2a2a7b23 201 test_prettydebug => {
202 req => $json_any,
203 },
204
226d1c35 205 test_leaks => {
f6b26571 206 req => {
f6b26571 207 'Test::Memory::Cycle' => '0',
208 'Devel::Cycle' => '1.10',
a109c954 209 },
210 },
f6b26571 211
68de9438 212 test_dt => {
213 req => $datetime_basic,
214 },
215
216 test_dt_sqlite => {
a109c954 217 req => {
68de9438 218 %$datetime_basic,
f6b26571 219 # t/36datetime.t
220 # t/60core.t
221 'DateTime::Format::SQLite' => '0',
68de9438 222 },
223 },
f6b26571 224
68de9438 225 test_dt_mysql => {
226 req => {
227 %$datetime_basic,
9c92bb1c 228 # t/inflate/datetime_mysql.t
229 # (doesn't need Mysql itself)
68de9438 230 'DateTime::Format::MySQL' => '0',
231 },
232 },
9c92bb1c 233
68de9438 234 test_dt_pg => {
235 req => {
236 %$datetime_basic,
9c92bb1c 237 # t/inflate/datetime_pg.t
238 # (doesn't need PG itself)
ab35aeab 239 'DateTime::Format::Pg' => '0.16004',
f6b26571 240 },
8057ed01 241 },
242
68de9438 243 test_cdbicompat => {
f6b26571 244 req => {
d9bd5195 245 'Class::DBI' => 0,
f6b26571 246 'Class::DBI::Plugin::DeepAbstractSearch' => '0',
d9bd5195 247 %$datetime_basic,
f6b26571 248 'Time::Piece::MySQL' => '0',
f6b26571 249 'Date::Simple' => '3.03',
250 },
8057ed01 251 },
252
be68095d 253 # this is just for completeness as SQLite
254 # is a core dep of DBIC for testing
255 rdbms_sqlite => {
256 req => {
257 %$rdbms_sqlite,
258 },
259 pod => {
260 title => 'SQLite support',
261 desc => 'Modules required to connect to SQLite',
262 },
263 },
264
265 rdbms_pg => {
266 req => {
a4fc1239 267 # when changing this list make sure to adjust xt/optional_deps.t
be68095d 268 %$rdbms_pg,
269 },
270 pod => {
271 title => 'PostgreSQL support',
272 desc => 'Modules required to connect to PostgreSQL',
273 },
274 },
275
276 rdbms_mssql_odbc => {
277 req => {
278 %$rdbms_mssql_odbc,
279 },
280 pod => {
281 title => 'MSSQL support via DBD::ODBC',
282 desc => 'Modules required to connect to MSSQL via DBD::ODBC',
283 },
284 },
285
286 rdbms_mssql_sybase => {
287 req => {
288 %$rdbms_mssql_sybase,
289 },
290 pod => {
291 title => 'MSSQL support via DBD::Sybase',
56dca25f 292 desc => 'Modules required to connect to MSSQL via DBD::Sybase',
293 },
294 },
295
296 rdbms_mssql_ado => {
297 req => {
298 %$rdbms_mssql_ado,
299 },
300 pod => {
301 title => 'MSSQL support via DBD::ADO (Windows only)',
302 desc => 'Modules required to connect to MSSQL via DBD::ADO. This particular DBD is available on Windows only',
be68095d 303 },
304 },
305
726c8f65 306 rdbms_msaccess_odbc => {
307 req => {
308 %$rdbms_msaccess_odbc,
309 },
310 pod => {
311 title => 'MS Access support via DBD::ODBC',
312 desc => 'Modules required to connect to MS Access via DBD::ODBC',
313 },
314 },
315
316 rdbms_msaccess_ado => {
317 req => {
318 %$rdbms_msaccess_ado,
319 },
320 pod => {
321 title => 'MS Access support via DBD::ADO (Windows only)',
322 desc => 'Modules required to connect to MS Access via DBD::ADO. This particular DBD is available on Windows only',
323 },
324 },
325
be68095d 326 rdbms_mysql => {
327 req => {
328 %$rdbms_mysql,
329 },
330 pod => {
331 title => 'MySQL support',
332 desc => 'Modules required to connect to MySQL',
333 },
334 },
335
336 rdbms_oracle => {
337 req => {
338 %$rdbms_oracle,
339 },
340 pod => {
341 title => 'Oracle support',
342 desc => 'Modules required to connect to Oracle',
343 },
344 },
345
346 rdbms_ase => {
347 req => {
348 %$rdbms_ase,
349 },
350 pod => {
351 title => 'Sybase ASE support',
352 desc => 'Modules required to connect to Sybase ASE',
353 },
354 },
355
356 rdbms_db2 => {
357 req => {
358 %$rdbms_db2,
359 },
360 pod => {
361 title => 'DB2 support',
362 desc => 'Modules required to connect to DB2',
363 },
364 },
365
199fbc45 366 rdbms_db2_400 => {
367 req => {
368 %$rdbms_db2_400,
369 },
370 pod => {
371 title => 'DB2 on AS/400 support',
372 desc => 'Modules required to connect to DB2 on AS/400',
373 },
374 },
375
376 rdbms_informix => {
377 req => {
378 %$rdbms_informix,
379 },
380 pod => {
381 title => 'Informix support',
382 desc => 'Modules required to connect to Informix',
383 },
8273e845 384 },
199fbc45 385
386 rdbms_sqlanywhere => {
387 req => {
388 %$rdbms_sqlanywhere,
389 },
390 pod => {
391 title => 'SQLAnywhere support',
392 desc => 'Modules required to connect to SQLAnywhere',
393 },
8273e845 394 },
199fbc45 395
396 rdbms_sqlanywhere_odbc => {
397 req => {
398 %$rdbms_sqlanywhere_odbc,
399 },
400 pod => {
401 title => 'SQLAnywhere support via DBD::ODBC',
402 desc => 'Modules required to connect to SQLAnywhere via DBD::ODBC',
403 },
8273e845 404 },
199fbc45 405
406 rdbms_firebird => {
407 req => {
408 %$rdbms_firebird,
409 },
410 pod => {
411 title => 'Firebird support',
412 desc => 'Modules required to connect to Firebird',
413 },
8273e845 414 },
199fbc45 415
416 rdbms_firebird_interbase => {
417 req => {
418 %$rdbms_firebird_interbase,
419 },
420 pod => {
421 title => 'Firebird support via DBD::InterBase',
422 desc => 'Modules required to connect to Firebird via DBD::InterBase',
423 },
8273e845 424 },
199fbc45 425
426 rdbms_firebird_odbc => {
427 req => {
428 %$rdbms_firebird_odbc,
429 },
430 pod => {
431 title => 'Firebird support via DBD::ODBC',
432 desc => 'Modules required to connect to Firebird via DBD::ODBC',
433 },
8273e845 434 },
199fbc45 435
be68095d 436# the order does matter because the rdbms support group might require
437# a different version that the test group
68de9438 438 test_rdbms_pg => {
f6b26571 439 req => {
440 $ENV{DBICTEST_PG_DSN}
441 ? (
a4fc1239 442 # when changing this list make sure to adjust xt/optional_deps.t
be68095d 443 %$rdbms_pg,
b9d84a2d 444 ($^O ne 'MSWin32' ? ('Sys::SigAction' => '0') : ()),
f6b26571 445 'DBD::Pg' => '2.009002',
f6b26571 446 ) : ()
447 },
8057ed01 448 },
449
afae8507 450 test_rdbms_mssql_odbc => {
451 req => {
452 $ENV{DBICTEST_MSSQL_ODBC_DSN}
453 ? (
be68095d 454 %$rdbms_mssql_odbc,
afae8507 455 ) : ()
456 },
457 },
458
56dca25f 459 test_rdbms_mssql_ado => {
460 req => {
461 $ENV{DBICTEST_MSSQL_ADO_DSN}
462 ? (
463 %$rdbms_mssql_ado,
464 ) : ()
465 },
466 },
467
afae8507 468 test_rdbms_mssql_sybase => {
469 req => {
470 $ENV{DBICTEST_MSSQL_DSN}
471 ? (
be68095d 472 %$rdbms_mssql_sybase,
afae8507 473 ) : ()
474 },
475 },
476
726c8f65 477 test_rdbms_msaccess_odbc => {
478 req => {
479 $ENV{DBICTEST_MSACCESS_ODBC_DSN}
480 ? (
481 %$rdbms_msaccess_odbc,
482 %$datetime_basic,
483 'Data::GUID' => '0',
484 ) : ()
485 },
486 },
487
488 test_rdbms_msaccess_ado => {
489 req => {
490 $ENV{DBICTEST_MSACCESS_ADO_DSN}
491 ? (
492 %$rdbms_msaccess_ado,
493 %$datetime_basic,
494 'Data::GUID' => 0,
495 ) : ()
496 },
497 },
498
68de9438 499 test_rdbms_mysql => {
f6b26571 500 req => {
501 $ENV{DBICTEST_MYSQL_DSN}
502 ? (
be68095d 503 %$rdbms_mysql,
f6b26571 504 ) : ()
505 },
8057ed01 506 },
507
68de9438 508 test_rdbms_oracle => {
f6b26571 509 req => {
510 $ENV{DBICTEST_ORA_DSN}
511 ? (
be68095d 512 %$rdbms_oracle,
f6b26571 513 'DateTime::Format::Oracle' => '0',
e1b7e9b4 514 'DBD::Oracle' => '1.24',
f6b26571 515 ) : ()
516 },
8057ed01 517 },
518
68de9438 519 test_rdbms_ase => {
f6b26571 520 req => {
521 $ENV{DBICTEST_SYBASE_DSN}
522 ? (
be68095d 523 %$rdbms_ase,
f6b26571 524 ) : ()
525 },
8057ed01 526 },
527
68de9438 528 test_rdbms_db2 => {
f58a165c 529 req => {
530 $ENV{DBICTEST_DB2_DSN}
531 ? (
be68095d 532 %$rdbms_db2,
f58a165c 533 ) : ()
534 },
535 },
536
199fbc45 537 test_rdbms_db2_400 => {
538 req => {
539 $ENV{DBICTEST_DB2_400_DSN}
540 ? (
541 %$rdbms_db2_400,
542 ) : ()
543 },
544 },
545
546 test_rdbms_informix => {
547 req => {
548 $ENV{DBICTEST_INFORMIX_DSN}
549 ? (
550 %$rdbms_informix,
551 ) : ()
552 },
553 },
554
555 test_rdbms_sqlanywhere => {
556 req => {
557 $ENV{DBICTEST_SQLANYWHERE_DSN}
558 ? (
559 %$rdbms_sqlanywhere,
560 ) : ()
561 },
562 },
563
564 test_rdbms_sqlanywhere_odbc => {
565 req => {
566 $ENV{DBICTEST_SQLANYWHERE_ODBC_DSN}
567 ? (
568 %$rdbms_sqlanywhere_odbc,
569 ) : ()
570 },
571 },
572
573 test_rdbms_firebird => {
574 req => {
575 $ENV{DBICTEST_FIREBIRD_DSN}
576 ? (
577 %$rdbms_firebird,
578 ) : ()
579 },
580 },
581
582 test_rdbms_firebird_interbase => {
583 req => {
584 $ENV{DBICTEST_FIREBIRD_INTERBASE_DSN}
585 ? (
586 %$rdbms_firebird_interbase,
587 ) : ()
588 },
589 },
590
e02b39b4 591 test_rdbms_firebird_odbc => {
592 req => {
593 $ENV{DBICTEST_FIREBIRD_ODBC_DSN}
594 ? (
595 %$rdbms_firebird_odbc,
596 ) : ()
597 },
598 },
599
42168332 600 test_memcached => {
601 req => {
602 $ENV{DBICTEST_MEMCACHED}
603 ? (
604 'Cache::Memcached' => 0,
605 ) : ()
606 },
607 },
608
8057ed01 609};
610
f6b26571 611
fb39747c 612sub req_list_for {
613 my ($class, $group) = @_;
614
9c1700e3 615 Carp::croak "req_list_for() expects a requirement group name"
fb39747c 616 unless $group;
617
f6b26571 618 my $deps = $reqs->{$group}{req}
9c1700e3 619 or Carp::croak "Requirement group '$group' does not exist";
fb39747c 620
621 return { %$deps };
622}
623
624
625our %req_availability_cache;
626sub req_ok_for {
627 my ($class, $group) = @_;
628
9c1700e3 629 Carp::croak "req_ok_for() expects a requirement group name"
fb39747c 630 unless $group;
631
d8799bab 632 return $class->_check_deps($group)->{status};
fb39747c 633}
634
635sub req_missing_for {
636 my ($class, $group) = @_;
637
9c1700e3 638 Carp::croak "req_missing_for() expects a requirement group name"
fb39747c 639 unless $group;
640
d8799bab 641 return $class->_check_deps($group)->{missing};
fb39747c 642}
643
644sub req_errorlist_for {
645 my ($class, $group) = @_;
646
9c1700e3 647 Carp::croak "req_errorlist_for() expects a requirement group name"
fb39747c 648 unless $group;
649
d8799bab 650 return $class->_check_deps($group)->{errorlist};
fb39747c 651}
652
653sub _check_deps {
654 my ($class, $group) = @_;
655
d8799bab 656 return $req_availability_cache{$group} ||= do {
657
658 my $deps = $class->req_list_for ($group);
659
660 my %errors;
661 for my $mod (keys %$deps) {
662 my $req_line = "require $mod;";
663 if (my $ver = $deps->{$mod}) {
664 $req_line .= "$mod->VERSION($ver);";
665 }
666
667 eval $req_line;
668
669 $errors{$mod} = $@ if $@;
670 }
671
672 my $res;
fb39747c 673
d8799bab 674 if (keys %errors) {
675 my $missing = join (', ', map { $deps->{$_} ? "$_ >= $deps->{$_}" : $_ } (sort keys %errors) );
676 $missing .= " (see $class for details)" if $reqs->{$group}{pod};
677 $res = {
678 status => 0,
679 errorlist => \%errors,
680 missing => $missing,
681 };
fb39747c 682 }
683 else {
d8799bab 684 $res = {
685 status => 1,
686 errorlist => {},
687 missing => '',
688 };
fb39747c 689 }
690
d8799bab 691 $res;
692 };
fb39747c 693}
694
e3fc11e1 695sub req_group_list {
696 return { map { $_ => { %{ $reqs->{$_}{req} || {} } } } (keys %$reqs) };
697}
698
699# This is to be called by the author only (automatically in Makefile.PL)
f6b26571 700sub _gen_pod {
47589465 701 my ($class, $distver, $pod_dir) = @_;
31fa1764 702
47589465 703 die "No POD root dir supplied" unless $pod_dir;
31fa1764 704
ccebe1f1 705 $distver ||=
31fa1764 706 eval { require DBIx::Class; DBIx::Class->VERSION; }
707 ||
ccebe1f1 708 die
31fa1764 709"\n\n---------------------------------------------------------------------\n" .
710'Unable to load core DBIx::Class module to determine current version, '.
711'possibly due to missing dependencies. Author-mode autodocumentation ' .
712"halted\n\n" . $@ .
713"\n\n---------------------------------------------------------------------\n"
31fa1764 714 ;
715
47589465 716 # do not ask for a recet version, use 1.x API calls
717 # this *may* execute on a smoker with old perl or whatnot
718 require File::Path;
719
720 (my $modfn = __PACKAGE__ . '.pm') =~ s|::|/|g;
721
722 (my $podfn = "$pod_dir/$modfn") =~ s/\.pm$/\.pod/;
723 (my $dir = $podfn) =~ s|/[^/]+$||;
724
725 File::Path::mkpath([$dir]);
726
e3fc11e1 727 my $sqltver = $class->req_list_for ('deploy')->{'SQL::Translator'}
728 or die "Hrmm? No sqlt dep?";
7e3dc46f 729
f6b26571 730 my @chunks = (
6343a203 731 <<"EOC",
af4ac504 732#########################################################################
733##################### A U T O G E N E R A T E D ########################
734#########################################################################
735#
736# The contents of this POD file are auto-generated. Any changes you make
737# will be lost. If you need to change the generated text edit _gen_pod()
738# at the end of $modfn
739#
740EOC
f6b26571 741 '=head1 NAME',
7e3dc46f 742 "$class - Optional module dependency specifications (for module authors)",
e3fc11e1 743 '=head1 SYNOPSIS',
d8799bab 744 <<"EOS",
7e3dc46f 745Somewhere in your build-file (e.g. L<Module::Install>'s Makefile.PL):
746
747 ...
748
749 configure_requires 'DBIx::Class' => '$distver';
750
751 require $class;
752
be68095d 753 my \$deploy_deps = $class->req_list_for('deploy');
7e3dc46f 754
755 for (keys %\$deploy_deps) {
756 requires \$_ => \$deploy_deps->{\$_};
757 }
758
759 ...
760
761Note that there are some caveats regarding C<configure_requires()>, more info
762can be found at L<Module::Install/configure_requires>
763EOS
f6b26571 764 '=head1 DESCRIPTION',
765 <<'EOD',
766Some of the less-frequently used features of L<DBIx::Class> have external
767module dependencies on their own. In order not to burden the average user
768with modules he will never use, these optional dependencies are not included
769in the base Makefile.PL. Instead an exception with a descriptive message is
770thrown when a specific feature is missing one or several modules required for
771its operation. This module is the central holding place for the current list
7e3dc46f 772of such dependencies, for DBIx::Class core authors, and DBIx::Class extension
773authors alike.
f6b26571 774EOD
775 '=head1 CURRENT REQUIREMENT GROUPS',
776 <<'EOD',
777Dependencies are organized in C<groups> and each group can list one or more
778required modules, with an optional minimum version (or 0 for any version).
ecb68746 779The group name can be used in the
f6b26571 780EOD
781 );
782
783 for my $group (sort keys %$reqs) {
784 my $p = $reqs->{$group}{pod}
785 or next;
786
787 my $modlist = $reqs->{$group}{req}
788 or next;
789
790 next unless keys %$modlist;
791
792 push @chunks, (
793 "=head2 $p->{title}",
794 "$p->{desc}",
795 '=over',
796 ( map { "=item * $_" . ($modlist->{$_} ? " >= $modlist->{$_}" : '') } (sort keys %$modlist) ),
797 '=back',
798 "Requirement group: B<$group>",
799 );
800 }
801
802 push @chunks, (
803 '=head1 METHODS',
e3fc11e1 804 '=head2 req_group_list',
805 '=over',
d8799bab 806 '=item Arguments: none',
e3fc11e1 807 '=item Returns: \%list_of_requirement_groups',
808 '=back',
d8799bab 809 <<'EOD',
e3fc11e1 810This method should be used by DBIx::Class packagers, to get a hashref of all
811dependencies keyed by dependency group. Each key (group name) can be supplied
812to one of the group-specific methods below.
813EOD
814
f6b26571 815 '=head2 req_list_for',
816 '=over',
817 '=item Arguments: $group_name',
818 '=item Returns: \%list_of_module_version_pairs',
819 '=back',
d8799bab 820 <<'EOD',
f6b26571 821This method should be used by DBIx::Class extension authors, to determine the
7e3dc46f 822version of modules a specific feature requires in the B<current> version of
e3fc11e1 823DBIx::Class. See the L</SYNOPSIS> for a real-world
7e3dc46f 824example.
f6b26571 825EOD
826
827 '=head2 req_ok_for',
828 '=over',
829 '=item Arguments: $group_name',
830 '=item Returns: 1|0',
831 '=back',
d8799bab 832 <<'EOD',
833Returns true or false depending on whether all modules required by
834C<$group_name> are present on the system and loadable.
835EOD
f6b26571 836
837 '=head2 req_missing_for',
838 '=over',
839 '=item Arguments: $group_name',
840 '=item Returns: $error_message_string',
841 '=back',
d8799bab 842 <<"EOD",
f6b26571 843Returns a single line string suitable for inclusion in larger error messages.
844This method would normally be used by DBIx::Class core-module author, to
845indicate to the user that he needs to install specific modules before he will
846be able to use a specific feature.
847
e3fc11e1 848For example if some of the requirements for C<deploy> are not available,
849the returned string could look like:
f6b26571 850
e3fc11e1 851 SQL::Translator >= $sqltver (see $class for details)
f6b26571 852
853The author is expected to prepend the necessary text to this message before
854returning the actual error seen by the user.
855EOD
856
857 '=head2 req_errorlist_for',
858 '=over',
859 '=item Arguments: $group_name',
860 '=item Returns: \%list_of_loaderrors_per_module',
861 '=back',
862 <<'EOD',
863Returns a hashref containing the actual errors that occured while attempting
864to load each module in the requirement group.
865EOD
fb8ae353 866 '=head1 AUTHOR',
867 'See L<DBIx::Class/CONTRIBUTORS>.',
868 '=head1 LICENSE',
869 'You may distribute this code under the same terms as Perl itself',
f6b26571 870 );
871
9c1700e3 872 open (my $fh, '>', $podfn) or Carp::croak "Unable to write to $podfn: $!";
f6b26571 873 print $fh join ("\n\n", @chunks);
47589465 874 print $fh "\n";
f6b26571 875 close ($fh);
876}
877
8057ed01 8781;