package SQL::Translator;
-# ----------------------------------------------------------------------
-# $Id: Translator.pm,v 1.72 2007-09-26 13:20:09 schiffbruechige Exp $
-# ----------------------------------------------------------------------
-# Copyright (C) 2002-4 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 $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.08001';
-$REVISION = sprintf "%d.%02d", q$Revision: 1.72 $ =~ /(\d+)\.(\d+)/;
+$VERSION = '0.11007';
$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;
# ----------------------------------------------------------------------
$data = join '', @$data;
}
elsif (isa($data, 'GLOB')) {
+ seek ($data, 0, 0) if eof ($data);
local $/;
$data = <$data>;
}
# 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";
=head1 AUTHORS
-The following people have contributed to the SQLFairy project:
+Alexander Hartmaier <abraxxa@cpan.org>
-=over 4
+Allen Day <allenday@users.sourceforge.net>
-=item * Mark Addison <grommit@users.sourceforge.net>
+Anders Nor Berle <berle@cpan.org>
-=item * Sam Angiuoli <angiuoli@users.sourceforge.net>
+Andrew Moore <amoore@cpan.org>
-=item * Dave Cash <dave@gnofn.org>
+Ben Faga <faga@cshl.edu>
-=item * Darren Chamberlain <dlc@users.sourceforge.net>
+Chris Hilton <chilton@alterpoint.com>
-=item * Ken Y. Clark <kclark@cpan.org>
+Chris Mungall <cjm@fruitfly.org>
-=item * Allen Day <allenday@users.sourceforge.net>
+Chris To <christot@users.sourceforge.net>
-=item * Paul Harrington <phrrngtn@users.sourceforge.net>
+Daniel Ruoso <daniel@ruoso.com>
-=item * Mikey Melillo <mmelillo@users.sourceforge.net>
+Darren Chamberlain <dlc@users.sourceforge.net>
-=item * Chris Mungall <cjm@fruitfly.org>
+Dave Cash <dave@gnofn.org>
-=item * Ross Smith II <rossta@users.sf.net>
+Fabien Wernli <faxmodem@cpan.org>
-=item * Gudmundur A. Thorisson <mummi@cshl.org>
+Geoff Cant <geoff@catalyst.net.nz>
-=item * Chris To <christot@users.sourceforge.net>
+Gudmundur A. Thorisson <mummi@cshl.org>
-=item * Jason Williams <smdwilliams@users.sourceforge.net>
+Guillermo Roditi <groditi@cpan.org>
-=item * Ying Zhang <zyolive@yahoo.com>
+Jason Williams <smdwilliams@users.sourceforge.net>
-=back
+Jonathan Yu <jawnsy@cpan.org>
+
+John Goulah <jgoulah@cpan.org>
+
+Ken Youens-Clark <kclark@cpan.org>
+
+Kevin McClellan <kdmcclel@gmail.com>
+
+Mark Addison <grommit@users.sourceforge.net>
+
+Mikey Melillo <mmelillo@users.sourceforge.net>
+
+Moritz Onken <onken@netcubed.de>
+
+Paul Harrington <phrrngtn@users.sourceforge.net>
+
+Peter Rabbitson <ribasushi@cpan.org>
+
+Ross Smith II <rossta@users.sf.net>
+
+Ryan D Johnson <ryan@innerfence.com>
+
+Sam Angiuoli <angiuoli@users.sourceforge.net>
+
+Stephen Bennett <stephen@freenode.net>
+
+Stephen Clouse <stephenclouse@gmail.com>
+
+Wallace Reis <wreis@cpan.org>
+
+Ying Zhang <zyolive@yahoo.com>
+
+=head1 COPYRIGHT
+
+Copyright (c) 2002-2011 the SQL::Translator L</AUTHORS> as listed
+above.
If you would like to contribute to the project, you can send patches
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 COPYRIGHT
+=head1 LICENSE
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