From: Mark Addison Date: Fri, 14 May 2004 00:46:32 +0000 (+0000) Subject: Documentation. X-Git-Tag: v0.06~55 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=11a8c77ab2663ad12f254fd3e292d8d16cb08918;p=dbsrgits%2FSQL-Translator.git Documentation. --- diff --git a/lib/SQL/Translator/Producer/TT/Base.pm b/lib/SQL/Translator/Producer/TT/Base.pm index 0cebbc3..e2dbc0b 100644 --- a/lib/SQL/Translator/Producer/TT/Base.pm +++ b/lib/SQL/Translator/Producer/TT/Base.pm @@ -1,7 +1,7 @@ package SQL::Translator::Producer::TT::Base; # ------------------------------------------------------------------- -# $Id: Base.pm,v 1.2 2004-05-13 22:52:00 grommit Exp $ +# $Id: Base.pm,v 1.3 2004-05-14 00:46:32 grommit Exp $ # ------------------------------------------------------------------- # Copyright (C) 2002-4 SQLFairy Authors # @@ -20,46 +20,19 @@ package SQL::Translator::Producer::TT::Base; # 02111-1307 USA # ------------------------------------------------------------------- -=pod +=pod =head1 NAME -SQL::Translator::Producer::TT::Base - TT based Producer base class. - -=head1 SYNOPSIS - - package SQL::Translator::Producer::Foo; - use base qw/SQL::Translator::Producer::TT::Base/; - - # Convert produce call into an object of our new class - sub produce { return __PACKAGE__->new( translator => shift )->run; }; - - # Return file name or template source - sub tt_schema { local $/ = undef; return \; } - - # Extra vars to add to the template - sub tt_vars { ( foo => "bar" ); } - -=head1 DESCRIPTION - -A base class producer designed to be sub-classed to create new TT base -producers cheaply by simply giving the template to use and sprinkling in some -extra template variables. - -See the synopsis above for an example of creating a simple producer using -a single template stored in the producers DATA section. - -WARNING: This is currently WORK IN PROGRESS and so subject to change, -but it does work ;-) +SQL::Translator::Producer::TT::Base - TT (Template Toolkit) based Producer base +class. =cut -# ------------------------------------------------------------------- - use strict; use vars qw[ $VERSION @EXPORT_OK ]; -$VERSION = sprintf "%d.%02d", q$Revision: 1.2 $ =~ /(\d+)\.(\d+)/; +$VERSION = sprintf "%d.%02d", q$Revision: 1.3 $ =~ /(\d+)\.(\d+)/; use Template; use Data::Dumper; @@ -140,12 +113,14 @@ sub run { return $out; } -# Should returns a template file name to use, or a scalar ref of tt source, or -# an io handle. See L