/[Frey]/branches/mojo/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

Contents of /branches/mojo/lib/Frey/ClassBrowser.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 258 - (show annotations)
Tue Nov 4 20:26:59 2008 UTC (15 years, 5 months ago) by dpavlin
File size: 983 byte(s)
make Frey::Introspect default action if there is no
method specified in url, resulting in major reduction of
html everywhere which is nice
1 package Frey::ClassBrowser;
2 use Moose;
3
4 extends 'Frey';
5
6 use Frey::ClassLoader;
7 use Frey::Run;
8
9 our $markup;
10
11 sub markup {
12 return $markup if $markup;
13 my $f = Frey::ClassLoader->new;
14 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="/Frey-ObjectDesigner?class=$package">design</a>| if $package->can('collection');
22 }
23 }
24 my @inspect;
25 push @inspect, qq|<a href="/Frey-ObjectBrowser?class=$package">collection</a>| if $package->can('collection_table');
26 foreach my $try ( Frey::Run->execute ) {
27 push @inspect, qq|<a href="/$package/$try">$try</a>| if $package->can($try);
28 }
29 $html .= qq|</td><td>| . join('&nbsp;', @inspect) . qq|</td></tr>|;
30 }
31 $html = "<table>$html</table>" if $html;
32 $markup = $html;
33 }
34
35 1;

  ViewVC Help
Powered by ViewVC 1.1.26