/[Frey]/branches/mojo/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

Contents of /branches/mojo/lib/Frey/Mojo/Run.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 232 - (show annotations)
Sat Nov 1 15:16:33 2008 UTC (15 years, 5 months ago) by dpavlin
File size: 613 byte(s)
experimental markup runner (not working as well as I would like)
1 package Frey::Mojo::Run;
2
3 use strict;
4 use warnings;
5
6 use base 'Mojolicious::Controller';
7
8 use Data::Dump qw/dump/;
9 use Carp qw/confess/;
10
11 sub markup {
12 my ($self, $c) = @_;
13
14 warn "# ", dump( $c->match->captures );
15
16 # Response object
17 my $res = $c->res;
18 $res->code(200);
19 $res->headers->content_type('text/html');
20
21 my $params = $c->request->params->to_hash;
22 warn "# params ", dump( $params );
23
24 my $class = $c->match->captures->{class} || 'Frey::ClassBrowser';
25 $class =~ s{[/-]}{::}g;
26
27 my $o = $class->new( %$params );
28 $o->depends if $o->can('depends');
29
30 $res->body( $o->markup );
31 }
32
33 1;

  ViewVC Help
Powered by ViewVC 1.1.26