/[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 243 - (show annotations)
Sun Nov 2 21:24:04 2008 UTC (15 years, 5 months ago) by dpavlin
File size: 802 byte(s)
a swipe of refactoring to run under Mojo and Continuity with same REST API

- all objects are now invoked using URL path as object name and param
  (which doesn't work with Mojo as of this commit)
- Frey::Run is now usable Moose object for both servers
- move handling of Continuity bits into Frey::Server only
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 use Frey::ClassLoader;
12
13 warn "# load_all_classes ",dump( Frey::ClassLoader->new->load_all_classes() );
14
15 use Frey::Run;
16
17 sub markup {
18 my ($self, $c) = @_;
19
20 warn "# ", dump( $c->match->captures );
21
22 my $params = $c->request->params->to_hash;
23 warn "# params ", dump( $c->request->params );
24
25 my $class = $c->match->captures->{class} || 'Frey::ClassBrowser';
26 $class =~ s{[/-]}{::}g;
27
28 warn "# c ",dump( $c );
29
30 my $html = Frey::Run->new( class => $class )->html;
31
32 # Response objec
33 my $res = $c->res;
34 $res->code(200);
35 $res->headers->content_type('text/html');
36 $res->body( $html );
37 }
38
39 sub data {
40 my ($self, $c) = @_;
41 $self->markup( $c );
42 }
43
44 1;

  ViewVC Help
Powered by ViewVC 1.1.26