X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FSQL%2FTranslator.pm;h=0b9946e5b41f910115576e66db833eb64fa62d36;hb=7de0715cd3c9d0e5fde79c84859f5334575accfa;hp=645102c05e3e11d2877f71188c0f7e6544246525;hpb=5342f5c1a47ee390b226bf3d9b57cdfb8c803b63;p=dbsrgits%2FSQL-Translator.git diff --git a/lib/SQL/Translator.pm b/lib/SQL/Translator.pm index 645102c..0b9946e 100644 --- a/lib/SQL/Translator.pm +++ b/lib/SQL/Translator.pm @@ -1,9 +1,7 @@ package SQL::Translator; # ---------------------------------------------------------------------- -# $Id: Translator.pm,v 1.73 2007-10-24 10:55:45 schiffbruechige Exp $ -# ---------------------------------------------------------------------- -# Copyright (C) 2002-4 The SQLFairy Authors +# 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 @@ -21,24 +19,23 @@ package SQL::Translator; # ------------------------------------------------------------------- use strict; -use vars qw( $VERSION $REVISION $DEFAULT_SUB $DEBUG $ERROR ); +use vars qw( $VERSION $DEFAULT_SUB $DEBUG $ERROR ); use base 'Class::Base'; -require 5.004; +require 5.005; -$VERSION = '0.09000'; -$REVISION = sprintf "%d.%02d", q$Revision: 1.73 $ =~ /(\d+)\.(\d+)/; +$VERSION = '0.11005'; $DEBUG = 0 unless defined $DEBUG; $ERROR = ""; use Carp qw(carp); use Data::Dumper; -use Class::Base; use File::Find; use File::Spec::Functions qw(catfile); use File::Basename qw(dirname); use IO::Dir; +use SQL::Translator::Producer; use SQL::Translator::Schema; # ---------------------------------------------------------------------- @@ -321,6 +318,7 @@ sub data { $data = join '', @$data; } elsif (isa($data, 'GLOB')) { + seek ($data, 0, 0) if eof ($data); local $/; $data = <$data>; } @@ -536,8 +534,13 @@ sub translate { # Run producer # Calling wantarray in the eval no work, wrong scope. my $wantarray = wantarray ? 1 : 0; - eval { $wantarray ? @producer_output = $producer->($self) : - $producer_output = $producer->($self) }; + eval { + if ($wantarray) { + @producer_output = $producer->($self); + } else { + $producer_output = $producer->($self); + } + }; if ($@ || !( $producer_output || @producer_output)) { my $err = $@ || $self->error || "no results"; my $msg = "translate: Error with producer '$producer_type': $err"; @@ -1265,41 +1268,8 @@ Returns the version of the SQL::Translator release. =head1 AUTHORS -The following people have contributed to the SQLFairy project: - -=over 4 - -=item * Mark Addison - -=item * Sam Angiuoli - -=item * Anders Nor Berle - -=item * Dave Cash - -=item * Darren Chamberlain - -=item * Ken Y. Clark - -=item * Allen Day - -=item * Paul Harrington - -=item * Mikey Melillo - -=item * Chris Mungall - -=item * Ross Smith II - -=item * Gudmundur A. Thorisson - -=item * Chris To - -=item * Jason Williams - -=item * Ying Zhang - -=back +See the included AUTHORS file: +L If you would like to contribute to the project, you can send patches to the developers mailing list: