[Bast-commits] r8339 - in
branches/DBIx-Class-Schema-Loader/current: .
lib/DBIx/Class/Schema/Loader t
caelum at dev.catalyst.perl.org
caelum at dev.catalyst.perl.org
Sun Jan 17 14:43:09 GMT 2010
Author: caelum
Date: 2010-01-17 14:43:09 +0000 (Sun, 17 Jan 2010)
New Revision: 8339
Modified:
branches/DBIx-Class-Schema-Loader/current/Changes
branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader/Base.pm
branches/DBIx-Class-Schema-Loader/current/t/23dumpmore.t
Log:
added "generate_pod" option, defaults to on
Modified: branches/DBIx-Class-Schema-Loader/current/Changes
===================================================================
--- branches/DBIx-Class-Schema-Loader/current/Changes 2010-01-17 14:19:21 UTC (rev 8338)
+++ branches/DBIx-Class-Schema-Loader/current/Changes 2010-01-17 14:43:09 UTC (rev 8339)
@@ -1,5 +1,7 @@
Revision history for Perl extension DBIx::Class::Schema::Loader
+ - added 'generate_pod' option, defaults to on
+
0.04999_14 2010-01-14 06:47:07
- use_namespaces now default, with upgrade/downgrade support
- filter out un-selectable tables/views
Modified: branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader/Base.pm
===================================================================
--- branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader/Base.pm 2010-01-17 14:19:21 UTC (rev 8338)
+++ branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader/Base.pm 2010-01-17 14:43:09 UTC (rev 8339)
@@ -65,6 +65,7 @@
_rewriting_result_namespace
use_namespaces
result_namespace
+ generate_pod
/);
=head1 NAME
@@ -158,6 +159,13 @@
__PACKAGE__->naming('v5');
+=head2 generate_pod
+
+By default POD will be generated for columns and relationships, using database
+metadata for the text if available and supported (Postgres only so far.)
+
+Set this to C<0> to turn off all POD generation.
+
=head2 relationship_attrs
Hashref of attributes to pass to each generated relationship, listed
@@ -419,6 +427,7 @@
$self->_check_back_compat;
$self->use_namespaces(1) unless defined $self->use_namespaces;
+ $self->generate_pod(1) unless defined $self->generate_pod;
$self;
}
@@ -1379,6 +1388,8 @@
my $class = shift;
my $method = shift;
+ return unless $self->generate_pod;
+
if ( $method eq 'table' ) {
my ($table) = @_;
$self->_pod( $class, "=head1 NAME" );
@@ -1437,7 +1448,6 @@
$self->_raw_stmt( $class, "\n=cut\n" );
}
-
# Store a raw source line for a class (for dumping purposes)
sub _raw_stmt {
my ($self, $class, $stmt) = @_;
Modified: branches/DBIx-Class-Schema-Loader/current/t/23dumpmore.t
===================================================================
--- branches/DBIx-Class-Schema-Loader/current/t/23dumpmore.t 2010-01-17 14:19:21 UTC (rev 8338)
+++ branches/DBIx-Class-Schema-Loader/current/t/23dumpmore.t 2010-01-17 14:43:09 UTC (rev 8339)
@@ -222,6 +222,21 @@
do_dump_test(
classname => 'DBICTest::DumpMore::1',
+ options => { use_namespaces => 1, generate_pod => 0 },
+ error => '',
+ warnings => [
+ qr/Dumping manual schema for DBICTest::DumpMore::1 to directory /,
+ qr/Schema dump completed/,
+ ],
+ neg_regexes => {
+ 'Result/Foo' => [
+ qr/^=/m,
+ ],
+ },
+);
+
+do_dump_test(
+ classname => 'DBICTest::DumpMore::1',
options => { use_namespaces => 1 },
error => '',
warnings => [
More information about the Bast-commits
mailing list