break try catch into multiple lines
Justin Hunter [Sat, 22 Aug 2009 21:28:49 +0000 (14:28 -0700)]
lib/SQL/Translator.pm

index 1170ab5..711bca4 100644 (file)
@@ -80,9 +80,14 @@ class SQL::Translator {
     method _build__producer {
         my $class = 'SQL::Translator::Producer';
         my $role = $class . '::' . $self->producer;
-    
+
         Class::MOP::load_class($class);
-        try { Class::MOP::load_class($role) } catch ($e) { warn "ERROR: $e"; $role = $class . '::SQL::' . $self->producer; Class::MOP::load_class($role) }
+        try {
+            Class::MOP::load_class($role)
+        } catch ($e) {
+            $role = $class . '::SQL::' . $self->producer;
+            Class::MOP::load_class($role)
+        }
     
         my $producer = $class->new({ translator => $self });
         $role->meta->apply($producer);
@@ -94,12 +99,13 @@ class SQL::Translator {
         if ($parser) {
             $self->_clear_parser;
             $self->parser($parser);
-            $self->schema($self->parse($data));
+            $self->parse($data);
+            $self->schema;
         } elsif ($producer) {
             $self->_clear_producer;
             $self->schema($self->parse($data)) if $data;
             $self->producer($producer);
-            return $self->produce;
+            $self->produce;
         }
     }