/[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 627 - (show annotations)
Sat Nov 29 22:02:08 2008 UTC (15 years, 4 months ago) by dpavlin
File size: 915 byte(s)
split out Continuity based bits to Frey::Server::Continuity
and work a bit on Frey::Mojo
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 as_markup {
20 my ($self, $c) = @_;
21
22 warn "# ", dump( $c->match->tx->req->url->query->params );
23
24 my $params = $c->match->tx->req->url->query->params;
25 warn "# params ", dump( $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(
33 class => $class,
34 request_url => $c->match->tx->req->url,
35 )->html;
36
37 # Response objec
38 my $res = $c->res;
39 $res->code(200);
40 $res->headers->content_type('text/html');
41 $res->body( $html );
42 }
43
44 sub as_data {
45 my ($self, $c) = @_;
46 $self->as_markup( $c );
47 }
48
49 1;

  ViewVC Help
Powered by ViewVC 1.1.26