package SQL::Translator::Producer::TTSchema;
-# -------------------------------------------------------------------
-# Copyright (C) 2002-2009 SQLFairy Authors
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; version 2.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-# 02111-1307 USA
-# -------------------------------------------------------------------
-
-=pod
+=pod
=head1 NAME
ttfile => 'foo_template.tt', # Template file to use
# Extra template variables
- ttargs => {
+ tt_vars => {
author => "Mr Foo",
},
# Template config options
- ttargs => {
+ tt_conf => {
INCLUDE_PATH => '/foo/templates',
},
},
Produces schema output using a given Template Tookit template.
-It needs one additional producer_arg of C<ttfile> which is the file
+It needs one additional producer arg of C<ttfile> which is the file
name of the template to use. This template will be passed a variable
called C<schema>, which is the C<SQL::Translator::Producer::Schema> object
created by the parser. You can then use it to walk the schema via the
See F<t/data/template/basic.tt> for a more complete example.
-The template will also get the set of extra variables given as a hashref via the
-C<tt_vars> producer arg.
+The template will also get the set of extra variables given as a
+hashref via the C<tt_vars> producer arg. (Note that the old style of
+passing this config in the C<ttargs> producer arg has been
+deprecated).
-You can set any of the options used to initiallize the Template object by
-adding a tt_conf producer_arg. See Template Toolkit docs for details of
+You can set any of the options used to initialize the Template object by
+adding a C<tt_conf> producer arg. See Template Toolkit docs for details of
the options.
-(Note that the old style of passing this config directly in the producer args
+(Note that the old style of passing this config directly in the C<ttargs> producer args
has been deprecated).
to => 'TT',
producer_args => {
ttfile => 'foo_template.tt',
- ttargs => {},
- tt_conf = {
+ tt_vars => {},
+ tt_conf => {
INCLUDE_PATH => '/foo/templates/tt',
INTERPOLATE => 1,
}
=cut
-# -------------------------------------------------------------------
-
use strict;
+use warnings;
-use vars qw[ $DEBUG $VERSION @EXPORT_OK ];
-$VERSION = '1.60';
+our ( $DEBUG, @EXPORT_OK );
+our $VERSION = '1.59';
$DEBUG = 0 unless defined $DEBUG;
use Template;
1;
-# -------------------------------------------------------------------
-
=pod
=head1 AUTHOR