/[Frey]/trunk/lib/Frey/Mojo/Run.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/Mojo/Run.pm

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

revision 272 by dpavlin, Wed Nov 5 08:20:46 2008 UTC revision 277 by dpavlin, Wed Nov 5 08:20:50 2008 UTC
# Line 10  use Carp qw/confess/; Line 10  use Carp qw/confess/;
10    
11  use Frey::ClassLoader;  use Frey::ClassLoader;
12    
13  warn "# ",dump( Frey::ClassLoader->new->load_all_classes() );  warn "# load_all_classes ",dump( Frey::ClassLoader->new->load_all_classes() );
14    
15    use Frey::Run;
16    
17  sub markup {  sub markup {
18      my ($self, $c) = @_;      my ($self, $c) = @_;
# Line 19  sub markup { Line 20  sub markup {
20          warn "# ", dump( $c->match->captures );          warn "# ", dump( $c->match->captures );
21    
22          my $params = $c->request->params->to_hash;          my $params = $c->request->params->to_hash;
23          warn "# params ", dump( $params );          warn "# params ", dump( $c->request->params );
24    
25          my $class = $c->match->captures->{class} || 'Frey::ClassBrowser';          my $class = $c->match->captures->{class} || 'Frey::ClassBrowser';
26          $class =~ s{[/-]}{::}g;          $class =~ s{[/-]}{::}g;
27    
28          my $o = $class->new( %$params );          warn "# c ",dump( $c );
         $o->depends if $o->can('depends');  
29    
30          my $html;          my $html = Frey::Run->new( class => $class )->html;
         if ( $o->can('markup') ) {  
                 $html = eval { $o->markup };  
                 if ( $@ ) {  
                         warn $@;  
                         $html .= qq{<code>$@</code>};  
                 }  
         } else {  
                 warn "SKIP: $class can't markup";  
         }  
   
         eval {  
                 # FIXME am I paranoid?  
                 package Mock::Web;  
                 use Moose;  
                 extends 'Frey';  
                 with 'Frey::Web';  
   
                 $html = Mock::Web->new->page(  
                         title => $class,  
                         body => $html,  
                 );  
         };  
31    
32      # Response objec      # Response objec
33      my $res = $c->res;      my $res = $c->res;
# Line 58  sub markup { Line 36  sub markup {
36          $res->body( $html );          $res->body( $html );
37  }  }
38    
39    sub data {
40            my ($self, $c) = @_;
41            $self->markup( $c );
42    }
43    
44  1;  1;

Legend:
Removed from v.272  
changed lines
  Added in v.277

  ViewVC Help
Powered by ViewVC 1.1.26