--- trunk/lib/Frey/Run.pm 2008/10/31 19:51:51 213 +++ trunk/lib/Frey/Run.pm 2008/11/01 13:17:45 229 @@ -2,6 +2,8 @@ use Moose; extends 'Frey'; with 'Frey::Web'; +with 'Frey::Config'; +with 'Frey::Escape'; =head1 NAME @@ -10,10 +12,12 @@ =head1 DESCRIPTION This object will try to run other Moose objects from your application. It -will try to invoke C or C method on the. +will try to invoke C, C or C method on the. =cut +sub execute { qw/data markup request/ } + has 'class' => ( is => 'rw', isa => 'Str', @@ -41,10 +45,16 @@ warn "## params = ",dump( %params ); my $html; + my $values = $self->config($class); + $values = {} if $@; if ( @required ) { $html = qq|

Required params for $class

|; - $html .= qq|| foreach @required; + foreach my $name ( @required ) { + my $type = $name =~ m/^pass/ ? 'password' : 'text'; + my $value = $values ? $values->{$name} : ''; + $html .= qq||; + } $html .= qq|
|; } else { my $o = $class->new( %params ); @@ -53,9 +63,11 @@ warn "## turning over to $o->request"; $o->request( $req ); } elsif ( $o->can('markup') ) { - warn "## using $o->markup"; + warn "## using ",ref($o), "->markup"; $html = $o->markup; warn ">>> markup $class ",length( $html ), " bytes\n"; + } elsif ( $o->can('data') ) { + $html = '' . $self->html_escape( dump( $o->data ) ) . ''; } else { $html = "IGNORE: $class ", $o->dump; warn $html;