Release commit for 1.62
[dbsrgits/SQL-Translator.git] / lib / SQL / Translator / Producer / HTML.pm
index 87c399d..0cdc711 100644 (file)
@@ -1,33 +1,13 @@
 package SQL::Translator::Producer::HTML;
 
-# -------------------------------------------------------------------
-# $Id$
-# -------------------------------------------------------------------
-# Copyright (C) 2002-4 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 warnings;
 use Data::Dumper;
-use vars qw($VERSION $NOWRAP $NOLINKTABLE $NAME);
 
-$VERSION = sprintf "%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/;
-$NAME = join ', ', __PACKAGE__, $VERSION;
-$NOWRAP = 0 unless defined $NOWRAP;
-$NOLINKTABLE = 0 unless defined $NOLINKTABLE;
+our $VERSION = '1.62';
+our $NAME = __PACKAGE__;
+our $NOWRAP = 0 unless defined $NOWRAP;
+our $NOLINKTABLE = 0 unless defined $NOLINKTABLE;
 
 # Emit XHTML by default
 $CGI::XHTML = $CGI::XHTML = 42;
@@ -58,7 +38,7 @@ sub produce {
                             import CGI::Pretty;
                                    CGI::Pretty->new }
                     : do { require CGI;
-                            import CGI; 
+                            import CGI;
                                    CGI->new };
     my ($table, @table_names);
 
@@ -73,7 +53,7 @@ sub produce {
             $q->hr;
     }
 
-    @table_names = grep { length $_->name } $schema->get_tables; 
+    @table_names = grep { length $_->name } $schema->get_tables;
 
     if ($linktable) {
         # Generate top menu, with links to full table information
@@ -81,7 +61,7 @@ sub produce {
         $count = sprintf "%d table%s", $count, $count == 1 ? '' : 's';
 
         # Leading table of links
-        push @html, 
+        push @html,
             $q->comment("Table listing ($count)"),
             $q->a({ -name => 'top' }),
             $q->start_table({ -width => '100%', -class => 'LinkTable'}),
@@ -97,7 +77,7 @@ sub produce {
 
         for my $table (@table_names) {
             my $table_name = $table->name;
-            push @html, 
+            push @html,
                 $q->comment("Start link to table '$table_name'"),
                 $q->Tr({ -class => 'LinkTableRow' },
                     $q->td({ -class => 'LinkTableCell' },
@@ -139,15 +119,15 @@ sub produce {
             $q->start_table({ -border => 1 }),
                 $q->Tr(
                     $q->th({ -class => 'FieldHeader' },
-                           [ 
-                            'Field Name', 
-                            'Data Type', 
-                            'Size', 
-                            'Default Value', 
-                            'Other', 
-                            'Foreign Key' 
+                           [
+                            'Field Name',
+                            'Data Type',
+                            'Size',
+                            'Default Value',
+                            'Other',
+                            'Foreign Key'
                            ]
-                    ) 
+                    )
                 );
 
         my $i = 0;
@@ -156,7 +136,7 @@ sub produce {
                $name      = qq[<a name="$table_name-$name">$name</a>];
             my $data_type = $field->data_type || '';
             my $size      = defined $field->size ? $field->size : '';
-            my $default   = defined $field->default_value 
+            my $default   = defined $field->default_value
                             ? $field->default_value : '';
             my $comment   = $field->comments  || '';
             my $fk        = '';
@@ -165,7 +145,7 @@ sub produce {
                 my $c         = $field->foreign_key_reference;
                 my $ref_table = $c->reference_table       || '';
                 my $ref_field = ($c->reference_fields)[0] || '';
-                $fk           = 
+                $fk           =
                 qq[<a href="#$ref_table-$ref_field">$ref_table.$ref_field</a>];
             }
 
@@ -192,11 +172,11 @@ sub produce {
         # Indices
         #
         if ( my @indices = $table->get_indices ) {
-            push @html, 
+            push @html,
                 $q->h3('Indices'),
                 $q->start_table({ -border => 1 }),
                     $q->Tr({ -class => 'IndexRow' },
-                        $q->th([ 'Name', 'Fields' ]) 
+                        $q->th([ 'Name', 'Fields' ])
                     );
 
             for my $index ( @indices ) {
@@ -215,14 +195,14 @@ sub produce {
         #
         # Constraints
         #
-        my @constraints = 
+        my @constraints =
             grep { $_->type ne PRIMARY_KEY } $table->get_constraints;
         if ( @constraints ) {
-            push @html, 
+            push @html,
                 $q->h3('Constraints'),
                 $q->start_table({ -border => 1 }),
                     $q->Tr({ -class => 'IndexRow' },
-                        $q->th([ 'Type', 'Fields' ]) 
+                        $q->th([ 'Type', 'Fields' ])
                     );
 
             for my $c ( @constraints ) {
@@ -333,7 +313,7 @@ insignificant whitespace and be generally smaller.
 
 =head1 AUTHORS
 
-Ken Y. Clark E<lt>kclark@cpan.orgE<gt>,
+Ken Youens-Clark E<lt>kclark@cpan.orgE<gt>,
 Darren Chamberlain E<lt>darren@cpan.orgE<gt>.
 
 =cut