[Bps-public-commit] r13887 - in Lorzy/trunk: lorzyplate/Lorzy-Plate/lib/Lorzy/Plate/Action

sartak at bestpractical.com sartak at bestpractical.com
Tue Jul 8 16:44:11 EDT 2008


Author: sartak
Date: Tue Jul  8 16:44:11 2008
New Revision: 13887

Modified:
   Lorzy/trunk/   (props changed)
   Lorzy/trunk/lorzyplate/Lorzy-Plate/lib/Lorzy/Plate/Action/RunL.pm

Log:
 r63880 at onn:  sartak | 2008-07-08 16:44:06 -0400
 More cleanup of RunL


Modified: Lorzy/trunk/lorzyplate/Lorzy-Plate/lib/Lorzy/Plate/Action/RunL.pm
==============================================================================
--- Lorzy/trunk/lorzyplate/Lorzy-Plate/lib/Lorzy/Plate/Action/RunL.pm	(original)
+++ Lorzy/trunk/lorzyplate/Lorzy-Plate/lib/Lorzy/Plate/Action/RunL.pm	Tue Jul  8 16:44:11 2008
@@ -8,14 +8,12 @@
 };
 
 sub take_action {
-    my $self    = shift;
-    my $tree    = JSON::from_json($self->argument_value('struct'));
-    my $builder = Lorzy::Builder->new;
-    my $eval    = Lorzy::Evaluator->new;
+    my $self = shift;
+    my $tree = JSON::from_json($self->argument_value('struct'));
 
     my $MATCH_REGEX = Lorzy::Lambda::Native->new(
         body => sub {
-            my $args = shift;
+            my $args  = shift;
             my $arg   = $args->{'tested-string'};
             my $regex = $args->{'regexp'};
             return $arg =~ m/$regex/;
@@ -23,7 +21,7 @@
         signature => {
            'tested-string' => Lorzy::FunctionArgument->new(
                name => 'tested-string',
-               type => 'Str'
+               type => 'Str',
            ),
            'regexp' => Lorzy::FunctionArgument->new(
                name => 'regex',
@@ -32,20 +30,21 @@
         }
     );
 
+    my $eval = Lorzy::Evaluator->new;
     $eval->set_global_symbol( 'match-regexp' => $MATCH_REGEX );
 
     eval {
-        my $script = $builder->defun(ops => $tree, signature => {});
+        my $builder = Lorzy::Builder->new;
+        my $script  = $builder->defun(ops => $tree, signature => {});
         $eval->apply_script($script, {});
     };
 
     if (my $msg = $@) {
         $self->result->error($msg);
     } else {
-        warn $eval->result->value, $eval->result->success;
         $self->result->message($eval->result->value);
-        $eval->result->success || $eval->result->error($eval->result->error);
     }
 }
 
 1;
+



More information about the Bps-public-commit mailing list