X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FSQL%2FTranslator%2FProducer%2FTTSchema.pm;h=5885d3b0638442d0e3277fe473c2b276abb0e28a;hb=c9c8f3e19f6af2ce0fe5cacd55b87b1d88c6e5eb;hp=ee5a7f1d42ffc0e2037a892933bf7145324588eb;hpb=d4f84dd192edc7a64a0b1a9923f1bafc0bc5ef9d;p=dbsrgits%2FSQL-Translator.git diff --git a/lib/SQL/Translator/Producer/TTSchema.pm b/lib/SQL/Translator/Producer/TTSchema.pm index ee5a7f1..5885d3b 100644 --- a/lib/SQL/Translator/Producer/TTSchema.pm +++ b/lib/SQL/Translator/Producer/TTSchema.pm @@ -1,26 +1,6 @@ package SQL::Translator::Producer::TTSchema; -# ------------------------------------------------------------------- -# $Id: TTSchema.pm 1440 2009-01-17 16:31:57Z jawnsy $ -# ------------------------------------------------------------------- -# 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 @@ -38,12 +18,12 @@ SQL::Translator::Producer::TTSchema - 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', }, }, @@ -54,7 +34,7 @@ SQL::Translator::Producer::TTSchema - Produces schema output using a given Template Tookit template. -It needs one additional producer_arg of C which is the file +It needs one additional producer arg of C which is the file name of the template to use. This template will be passed a variable called C, which is the C object created by the parser. You can then use it to walk the schema via the @@ -74,13 +54,15 @@ Here's a brief example of what the template could look like: See F for a more complete example. -The template will also get the set of extra variables given as a hashref via the -C producer arg. +The template will also get the set of extra variables given as a +hashref via the C producer arg. (Note that the old style of +passing this config in the C 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 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 producer args has been deprecated). @@ -88,8 +70,8 @@ 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, } @@ -124,11 +106,11 @@ constructor. =cut -# ------------------------------------------------------------------- - use strict; +use warnings; -use vars qw[ $DEBUG @EXPORT_OK ]; +our ( $DEBUG, @EXPORT_OK ); +our $VERSION = '1.59'; $DEBUG = 0 unless defined $DEBUG; use Template; @@ -187,8 +169,6 @@ sub produce { 1; -# ------------------------------------------------------------------- - =pod =head1 AUTHOR