--- trunk/lib/Frey/Run.pm 2008/11/08 23:03:35 336 +++ trunk/lib/Frey/Run.pm 2008/11/15 23:52:22 348 @@ -20,7 +20,7 @@ =cut -sub runnable { qw/data markup/ } +sub runnable { qw/data markup sponge/ } has 'class' => ( is => 'rw', @@ -68,12 +68,24 @@ foreach my $name ( @attrs ) { my $attr = $class->meta->get_attribute( $name ); my $type = $name =~ m/^pass/ ? 'password' : 'text'; - my $value = - $values ? $values->{$name} : - $attr->has_default ? $attr->default( $name ) : - ''; + my $value = ''; + my $value_html = ''; + if ( ref($values) eq 'HASH' ) { + $value = $values->{$name}; + } elsif ( ref($values) eq 'ARRAY' ) { + $value_html = qq||; + } else { + $value = $attr->default( $name ) if $attr->has_default; + } + $value_html = qq|| unless $value_html; + #warn "# required $name ", $class->meta->get_attribute( $name )->dump( 2 ); - $html .= qq||; + $html .= qq|| . $value_html; } $html .= qq||; } else { @@ -87,6 +99,12 @@ $html .= qq{$@}; } warn ">>> markup $class ",length( $html ), " bytes\n"; + } elsif ( $o->can('sponge') ) { + my $data = $o->sponge; + $html .= ''; + $html .= ''; + $html .= '' foreach @{ $data->{rows} }; + $html .= '
' . join('', @{$data->{NAME}} ) . '
' . join('', @$_ ) . '
'; } elsif ( $o->can('data') ) { my $data = $o->data; $html .= Frey::Dumper->new( data => $data )->markup;