[Bast-commits] r8218 -
branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader
rbuels at dev.catalyst.perl.org
rbuels at dev.catalyst.perl.org
Fri Jan 1 22:05:34 GMT 2010
Author: rbuels
Date: 2010-01-01 22:05:33 +0000 (Fri, 01 Jan 2010)
New Revision: 8218
Modified:
branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader/Base.pm
Log:
for clarity, extracted POD generation into its own method
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-01 21:54:22 UTC (rev 8217)
+++ branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader/Base.pm 2010-01-01 22:05:33 UTC (rev 8218)
@@ -1225,9 +1225,29 @@
# Execute a constructive DBIC class method, with debug/dump_to_dir hooks.
sub _dbic_stmt {
- my $self = shift;
- my $class = shift;
+ my $self = shift;
+ my $class = shift;
my $method = shift;
+
+ # generate the pod for this statement, storing it with $self->_pod
+ $self->_make_pod( $class, $method, @_ );
+
+ my $args = dump(@_);
+ $args = '(' . $args . ')' if @_ < 2;
+ my $stmt = $method . $args . q{;};
+
+ warn qq|$class\->$stmt\n| if $self->debug;
+ $self->_raw_stmt($class, '__PACKAGE__->' . $stmt);
+ return;
+}
+
+# generates the accompanying pod for a DBIC class method statement,
+# storing it with $self->_pod
+sub _make_pod {
+ my $self = shift;
+ my $class = shift;
+ my $method = shift;
+
if ( $method eq 'table' ) {
my ($table) = @_;
$self->_pod( $class, "=head1 NAME" );
@@ -1273,13 +1293,6 @@
$self->_pod_cut( $class );
$self->{_relations_started} { $class } = 1;
}
- my $args = dump(@_);
- $args = '(' . $args . ')' if @_ < 2;
- my $stmt = $method . $args . q{;};
-
- warn qq|$class\->$stmt\n| if $self->debug;
- $self->_raw_stmt($class, '__PACKAGE__->' . $stmt);
- return;
}
# Stores a POD documentation
More information about the Bast-commits
mailing list