take out duplicate docs
[dbsrgits/SQL-Translator.git] / lib / SQL / Translator / Producer / YAML.pm
index f6d349b..6dbdc07 100644 (file)
@@ -1,5 +1,23 @@
 package SQL::Translator::Producer::YAML;
 
+# -------------------------------------------------------------------
+# 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
+# -------------------------------------------------------------------
+
 =head1 NAME
 
 SQL::Translator::Producer::YAML - A YAML producer for SQL::Translator
@@ -25,27 +43,26 @@ $VERSION = '1.59';
 
 use YAML qw(Dump);
 
-# -------------------------------------------------------------------
 sub produce {
     my $translator = shift;
     my $schema     = $translator->schema;
 
     return Dump({
         schema => {
-            tables => { 
+            tables => {
                 map { ($_->name => view_table($_)) }
                     $schema->get_tables,
             },
-            views => { 
+            views => {
                 map { ($_->name => view_view($_)) }
                     $schema->get_views,
             },
-            triggers => { 
+            triggers => {
                 map { ($_->name => view_trigger($_)) }
                     $schema->get_triggers,
             },
-            procedures => { 
-                map { ($_->name => view_procedure($_)) } 
+            procedures => {
+                map { ($_->name => view_procedure($_)) }
                     $schema->get_procedures,
             },
         },
@@ -65,7 +82,6 @@ sub produce {
     });
 }
 
-# -------------------------------------------------------------------
 sub view_table {
     my $table = shift;
 
@@ -80,15 +96,14 @@ sub view_table {
         'indices'     => [
             map { view_index($_) } $table->get_indices
         ],
-        'fields'      => { 
+        'fields'      => {
             map { ($_->name => view_field($_)) }
-                $table->get_fields 
+                $table->get_fields
         },
         keys %{$table->extra} ? ('extra' => { $table->extra } ) : (),
     };
 }
 
-# -------------------------------------------------------------------
 sub view_constraint {
     my $constraint = shift;
 
@@ -108,7 +123,6 @@ sub view_constraint {
     };
 }
 
-# -------------------------------------------------------------------
 sub view_field {
     my $field = shift;
 
@@ -127,7 +141,6 @@ sub view_field {
     };
 }
 
-# -------------------------------------------------------------------
 sub view_procedure {
     my $procedure = shift;
 
@@ -142,7 +155,6 @@ sub view_procedure {
     };
 }
 
-# -------------------------------------------------------------------
 sub view_trigger {
     my $trigger = shift;
 
@@ -158,7 +170,6 @@ sub view_trigger {
     };
 }
 
-# -------------------------------------------------------------------
 sub view_view {
     my $view = shift;
 
@@ -171,7 +182,6 @@ sub view_view {
     };
 }
 
-# -------------------------------------------------------------------
 sub view_index {
     my $index = shift;
 
@@ -186,8 +196,6 @@ sub view_index {
 
 1;
 
-# -------------------------------------------------------------------
-
 =head1 SEE ALSO
 
 SQL::Translator, YAML, http://www.yaml.org/.