/[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

Contents of /trunk/lib/Frey/Mojo/Run.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 318 - (show annotations)
Wed Nov 5 22:05:40 2008 UTC (15 years, 5 months ago) by dpavlin
File size: 842 byte(s)
Mojo tweaks.. It now again breaks on :: in request
1 package Frey::Mojo::Run;
2
3 use strict;
4 use warnings;
5
6 my $debug = 1;
7
8 use base 'Mojolicious::Controller';
9
10 use Data::Dump qw/dump/;
11 use Carp qw/confess/;
12
13 use Frey::ClassLoader;
14
15 warn "# load_all_classes ",join(',', keys %{ Frey::ClassLoader->new->load_all_classes() } );
16
17 use Frey::Run;
18
19 sub markup {
20 my ($self, $c) = @_;
21
22 warn "# ", dump( $c->match->captures );
23
24 my $params = $c->request->params->to_hash;
25 warn "# params ", dump( $c->request->params );
26
27 my $class = $c->match->captures->{class} || 'Frey::ClassBrowser';
28 $class =~ s{[/-]}{::}g;
29
30 warn "# c ",dump( $c ) if $debug;
31
32 my $html = Frey::Run->new( class => $class )->html;
33
34 # Response objec
35 my $res = $c->res;
36 $res->code(200);
37 $res->headers->content_type('text/html');
38 $res->body( $html );
39 }
40
41 sub data {
42 my ($self, $c) = @_;
43 $self->markup( $c );
44 }
45
46 1;

  ViewVC Help
Powered by ViewVC 1.1.26