/[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 187 - (hide annotations)
Sat Sep 13 15:31:54 2008 UTC (15 years, 7 months ago) by dpavlin
File size: 1120 byte(s)
fixed inspect html markup
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 144 return $markup if $markup;
13 dpavlin 119 my $f = Frey::ClassLoader->new;
14 dpavlin 144 my $html;
15     foreach my $package ( $f->classes ) {
16     $html .= qq|<tr><td><a href="/~/$package" title="| . $f->package_path( $package ) . qq|">$package</a></td><td>|;
17     if ( $package->can('meta') ) {
18     if ( $package->meta->isa('Moose::Meta::Role') ) {
19     $html .= qq|role|;
20     } else {
21     $html .= qq|<a href="/od/$package">design</a>| if $package->can('collection');
22     }
23     }
24 dpavlin 187 my @inspect;
25     push @inspect, qq|<a href="/ob/$package">collection</a>| if $package->can('collection_table');
26     push @inspect, qq|<a href="/markup/$package">markup</a>| if $package->can('markup');
27     push @inspect, qq|<a href="/html/$package">html</a>| if $package->can('html');
28     $html .= qq|</td><td>| . join('&nbsp;', @inspect) . qq|</td></tr>|;
29 dpavlin 144 }
30     $html = "<table>$html</table>" if $html;
31     $markup = $html;
32 dpavlin 119 }
33    
34 dpavlin 121 sub html {
35     my ( $self, $req ) = @_;
36     my $html = $self->page( body => qq|<h1>Classes</h1>| . $self->markup );
37     $req->print( $html );
38     }
39    
40 dpavlin 119 1;

  ViewVC Help
Powered by ViewVC 1.1.26