/[Frey]/trunk/lib/Frey/Pipe.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/Frey/Pipe.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 401 by dpavlin, Tue Nov 18 02:17:06 2008 UTC revision 420 by dpavlin, Tue Nov 18 17:11:08 2008 UTC
# Line 35  sub markup { Line 35  sub markup {
35          my $out;          my $out;
36          my $pipe;          my $pipe;
37    
38            $self->title( ref($self) . ' | ' . $self->pipe );
39    
40          foreach my $part ( split(/\|/, $self->pipe ) ) {          foreach my $part ( split(/\|/, $self->pipe ) ) {
41                  warn "# part: '$part'";                  warn "# part: '$part'";
42                  if ( $part =~ m{^([^/]+)/([^\+\?]+)(.*)?$} ) {                  if ( $part =~ m{^([^/]+)/([^\+\?]+)(.*)?$} ) {
43                          my ( $class, $method, $args ) = ( $1, $2, $3 );                          my ( $class, $method, $args ) = ( $1, $2, $3 );
44                            push @{ $self->status }, { $class => { method => $method, args => $args } };
45                          my $params = $pipe;                          my $params = $pipe;
46                          $params = {} unless defined $params;                          $params = {} unless defined $params;
47                          if ( defined $args ) {                          if ( defined $args ) {
# Line 52  sub markup { Line 55  sub markup {
55                          }                          }
56    
57                          my ( $html, $default ) = Frey::Action->new( class => $class, params => $params )->params_form;                          my ( $html, $default ) = Frey::Action->new( class => $class, params => $params )->params_form;
58                          warn "$class need more params than ",dump( $default ) if $html; # FIXME replace with query                          warn "$class need more params than ",dump( $default ) if $html && $self->debug; # FIXME replace with query
59    
60                          my $code = '$result = ' . $class . '->new' . dump( %$default ) . '->' . $method . '();';                          my $code = '$result = ' . $class . '->new' . dump( %$default ) . '->' . $method . '();';
61                          warn "# pipe $part -> $code";                          warn "# pipe $part -> $code" if $self->debug;
62                          my $result;                          my $result;
63                          eval $code;                          eval $code;
64                          die $@ if $@;                          die $@ if $@;
# Line 68  sub markup { Line 71  sub markup {
71                  }                  }
72          }          }
73    
74          return '<code>' . $self->pipe . '</code>' . $out;          warn "# pipe ", $self->title, dump( $self->status );
75    
76            return $out;
77  }  }
78    
79  1;  1;

Legend:
Removed from v.401  
changed lines
  Added in v.420

  ViewVC Help
Powered by ViewVC 1.1.26