--- trunk/lib/Frey/Pipe.pm 2008/11/25 17:15:18 519 +++ trunk/lib/Frey/Pipe.pm 2009/01/06 13:18:43 940 @@ -1,8 +1,9 @@ package Frey::Pipe; use Moose; -extends 'Frey::ClassLoader'; +extends 'Frey::Class::Loader'; with 'Frey::Web'; +use lib 'lib'; use Frey::Action; =head1 DESCRIPTION @@ -27,6 +28,8 @@ default => 'Frey::Feed/as_data+uri=http://blog.rot13.org/index.xml|Frey::View::Dumper/as_markup', ); +sub render_pipe { 'radio' }; + use Data::Dump qw/dump/; sub as_markup { @@ -59,10 +62,28 @@ warn "# pipe $part" if $self->debug; my $o = $self->new_frey_class( $class, $default ); + + # XXX copy depends from parts of pipe + if ( $o->can('depends') ) { + $o->depends; + my $current_head; + $current_head->{$_}++ foreach $self->head; + foreach ( $o->head ) { + next if $current_head->{$_}++; + $self->add_head( $_ ); + } + } + my $result = $o->$method; warn "# result ",length( $result ), " bytes ", ref($result); - $self->add_status({ $part => { $class => { method => $method, args => $args } } }); + my $current_status; + $current_status->{$_}++ foreach $self->status; + foreach ( $o->status ) { + next if $current_status->{$_}++; + $self->add_status( $_ ); + warn "# pipe add_status: $_"; + } $self->content_type( $o->content_type ) if $o->can('content_type'); @@ -74,6 +95,8 @@ } } + $out = $self->error("$out not scalar" . $self->html_dump($out) ) if ref $out; + return $out; }