Changes and dep-bump
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Optional / Dependencies.pm
index 6870714..6bba18b 100644 (file)
@@ -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 => {
@@ -67,7 +66,7 @@ my $reqs = {
 
   deploy => {
     req => {
-      'SQL::Translator'           => '0.11002',
+      'SQL::Translator'           => '0.11005',
     },
     pod => {
       title => 'Storage::DBI::deploy()',
@@ -75,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',
     },
   },
 
@@ -117,7 +143,6 @@ my $reqs = {
         ? (
           'Sys::SigAction'        => '0',
           'DBD::Pg'               => '2.009002',
-          'DateTime::Format::Pg'  => '0',
         ) : ()
     },
   },
@@ -126,7 +151,6 @@ my $reqs = {
     req => {
       $ENV{DBICTEST_MYSQL_DSN}
         ? (
-          'DateTime::Format::MySQL' => '0',
           'DBD::mysql'              => '0',
         ) : ()
     },
@@ -152,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,
+        ) : ()
+    },
+  },
+
 };
 
 
@@ -247,11 +281,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 +302,30 @@ sub _gen_pod {
 #
 EOC
     '=head1 NAME',
-    "$class - Optional module dependency specifications",
+    "$class - Optional module dependency specifications (for module authors)",
+    '=head1 SYNOPSIS (EXPERIMENTAL)',
+    <<EOS,
+B<THE USAGE SHOWN HERE IS EXPERIMENTAL>
+
+Somewhere in your build-file (e.g. L<Module::Install>'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<configure_requires()>, more info
+can be found at L<Module::Install/configure_requires>
+EOS
     '=head1 DESCRIPTION',
     <<'EOD',
 Some of the less-frequently used features of L<DBIx::Class> have external
@@ -273,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',
@@ -311,17 +373,9 @@ EOD
     '=back',
     <<EOD,
 This method should be used by DBIx::Class extension authors, to determine the
-version of modules which a specific feature requires in the current version of
-DBIx::Class. For example if you write a module/extension that requires
-DBIx::Class and also requires the availability of
-L<DBIx::Class::Storage::DBI/deploy>, you can do the following in your
-C<Makefile.PL> or C<Build.PL>
-
- 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<current> version of
+DBIx::Class. See the L<SYNOPSIS|/SYNOPSIS (EXPERIMENTAL)> for a real-world
+example.
 EOD
 
     '=head2 req_ok_for',