/[Frey]/trunk/lib/Frey/ClassBrowser.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

Annotation of /trunk/lib/Frey/ClassBrowser.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 121 - (hide annotations)
Mon Jul 14 21:22:43 2008 UTC (15 years, 10 months ago) by dpavlin
File size: 843 byte(s)
central page creation [0.11]

- make (optional) development feature in Makefile.PL
- split page generation in Frey::Web->page
- cleanup of html generation code all over
- jump to Carp::REPL on errors (nice, but needs to be in browser)

This is a move to more embedded html. While it does seem evil, we are aming
here at lean framework, so readability is prefered...
1 dpavlin 119 package Frey::ClassBrowser;
2     use Moose;
3    
4 dpavlin 121 extends 'Frey';
5 dpavlin 119 with 'Frey::Web';
6    
7     use Frey::ClassLoader;
8    
9     our $markup;
10    
11 dpavlin 121 sub markup {
12 dpavlin 119 my $f = Frey::ClassLoader->new;
13     my $classes = dom2html(
14     table => [
15     map {
16     my $package = $_;
17     ( tr => [
18     td => [ a => { href => '/~/' . $package, title => $f->package_path( $package ) } => [ $package ] ],
19     td => [
20     $package->can('meta') ?
21     $package->meta->isa('Moose::Meta::Role') ? 'role' :
22     ( a => { href => '/od/' . $package } => [ 'design' ] ) :
23     ''
24     ],
25     td => [ $package->can('collection_table') ? ( a => { href => '/ob/' . $package } => [ 'collection' ] ) : '' ],
26     ] )
27     } $f->classes
28     ],
29     );
30     $markup = $classes;
31     }
32    
33 dpavlin 121 sub html {
34     my ( $self, $req ) = @_;
35     my $html = $self->page( body => qq|<h1>Classes</h1>| . $self->markup );
36     $req->print( $html );
37     }
38    
39 dpavlin 119 1;

  ViewVC Help
Powered by ViewVC 1.1.26