X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FSQL%2FTranslator.pm;h=af23b624b929a9970e13b1f5f13223a4c42f8d0f;hb=0e7580187aea709181804514465931b90f0145cd;hp=442297d731b68f0b284db11392781e931acc83bb;hpb=935800450f88b0500c4fa7c3b174cd22b5f9eb56;p=dbsrgits%2FSQL-Translator.git diff --git a/lib/SQL/Translator.pm b/lib/SQL/Translator.pm index 442297d..af23b62 100644 --- a/lib/SQL/Translator.pm +++ b/lib/SQL/Translator.pm @@ -1,12 +1,30 @@ package SQL::Translator; +# ---------------------------------------------------------------------- +# Copyright (C) 2002-2009 The 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 +# ------------------------------------------------------------------- + use strict; use vars qw( $VERSION $DEFAULT_SUB $DEBUG $ERROR ); use base 'Class::Base'; require 5.005; -$VERSION = '0.11007'; +$VERSION = '0.11009'; $DEBUG = 0 unless defined $DEBUG; $ERROR = ""; @@ -104,10 +122,10 @@ sub init { $self->trace( $config->{'trace'} ); $self->validate( $config->{'validate'} ); - - $self->quote_table_names( (defined $config->{'quote_table_names'} + + $self->quote_table_names( (defined $config->{'quote_table_names'} ? $config->{'quote_table_names'} : 1) ); - $self->quote_field_names( (defined $config->{'quote_field_names'} + $self->quote_field_names( (defined $config->{'quote_field_names'} ? $config->{'quote_field_names'} : 1) ); return $self; @@ -603,8 +621,8 @@ sub _args { # ---------------------------------------------------------------------- # Does the get/set work for parser and producer. e.g. -# return $self->_tool({ -# name => 'producer', +# return $self->_tool({ +# name => 'producer', # path => "SQL::Translator::Producer", # default_sub => "produce", # }, @_); @@ -617,7 +635,7 @@ sub _tool { my $path = $args->{path}; my $default_sub = $args->{default_sub}; my $tool = shift; - + # passed an anonymous subroutine reference if (isa($tool, 'CODE')) { $self->{$name} = $tool; @@ -671,7 +689,7 @@ sub _list { my $uctype = ucfirst lc $type; # - # First find all the directories where SQL::Translator + # First find all the directories where SQL::Translator # parsers or producers (the "type") appear to live. # load("SQL::Translator::$uctype") or return (); @@ -685,13 +703,13 @@ sub _list { } # - # Now use File::File::find to look recursively in those + # Now use File::File::find to look recursively in those # directories for all the *.pm files, then present them # with the slashes turned into dashes. # my %found; - find( - sub { + find( + sub { if ( -f && m/\.pm$/ ) { my $mod = $_; $mod =~ s/\.pm$//; @@ -748,7 +766,7 @@ sub load { return $module if $INC{$file}; # Already loaded eval { require $file }; - next if $@ =~ /Can't locate $file in \@INC/; + next if $@ =~ /Can't locate $file in \@INC/; eval { $module->import() } unless $@; return __PACKAGE__->error("Error loading $name as $module : $@") if $@ && $@ !~ /"SQL::Translator::Producer" is not exported/; @@ -991,7 +1009,7 @@ advantage is gained by passing options to the constructor. =head2 add_drop_table -Toggles whether or not to add "DROP TABLE" statements just before the +Toggles whether or not to add "DROP TABLE" statements just before the create definitions. =head2 quote_table_names @@ -1015,9 +1033,9 @@ The C method is an accessor/mutator, used to retrieve or define what subroutine is called to produce the output. A subroutine defined as a producer will be invoked as a function (I) and passed its container C instance, which it should -call the C method on, to get the C +call the C method on, to get the C generated by the parser. It is expected that the function transform the -schema structure to a string. The C instance is also useful +schema structure to a string. The C instance is also useful for informational purposes; for example, the type of the parser can be retrieved using the C method, and the C and C methods can be called when needed. @@ -1250,74 +1268,8 @@ Returns the version of the SQL::Translator release. =head1 AUTHORS -Alexander Hartmaier - -Allen Day - -Anders Nor Berle - -Andrew Moore - -Ben Faga - -Chris Hilton - -Chris Mungall - -Chris To - -Daniel Ruoso - -Darren Chamberlain - -Dave Cash - -Fabien Wernli - -Geoff Cant - -Gudmundur A. Thorisson - -Guillermo Roditi - -Jason Williams - -Jonathan Yu - -John Goulah - -Ken Youens-Clark - -Kevin McClellan - -Mark Addison - -Mikey Melillo - -Moritz Onken - -Paul Harrington - -Peter Rabbitson - -Ross Smith II - -Ryan D Johnson - -Sam Angiuoli - -Stephen Bennett - -Stephen Clouse - -Wallace Reis - -Ying Zhang - -=head1 COPYRIGHT - -Copyright (c) 2002-2011 the SQL::Translator L as listed -above. +See the included AUTHORS file: +L If you would like to contribute to the project, you can send patches to the developers mailing list: @@ -1327,7 +1279,8 @@ to the developers mailing list: Or send us a message (with your Sourceforge username) asking to be added to the project and what you'd like to contribute. -=head1 LICENSE + +=head1 COPYRIGHT 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 @@ -1349,7 +1302,7 @@ Please use L for reporting bugs. =head1 PRAISE -If you find this module useful, please use +If you find this module useful, please use L to rate it. =head1 SEE ALSO