2 |
use Moose; |
use Moose; |
3 |
|
|
4 |
extends 'Frey'; |
extends 'Frey'; |
|
with 'Frey::Web'; |
|
5 |
|
|
6 |
use Frey::ClassLoader; |
use Frey::ClassLoader; |
7 |
|
use Frey::Run; |
8 |
|
|
9 |
our $markup; |
our $markup; |
10 |
|
|
13 |
my $f = Frey::ClassLoader->new; |
my $f = Frey::ClassLoader->new; |
14 |
my $html; |
my $html; |
15 |
foreach my $package ( $f->classes ) { |
foreach my $package ( $f->classes ) { |
16 |
$html .= qq|<tr><td><a href="/~/$package" title="| . $f->package_path( $package ) . qq|">$package</a></td><td>|; |
$html .= qq|<tr><td><a href="/Frey-Introspect/markup?class=$package" title="| . $f->package_path( $package ) . qq|">$package</a></td><td>|; |
17 |
if ( $package->can('meta') ) { |
if ( $package->can('meta') ) { |
18 |
if ( $package->meta->isa('Moose::Meta::Role') ) { |
if ( $package->meta->isa('Moose::Meta::Role') ) { |
19 |
$html .= qq|role|; |
$html .= qq|role|; |
20 |
} else { |
} else { |
21 |
$html .= qq|<a href="/od/$package">design</a>| if $package->can('collection'); |
$html .= qq|<a href="/Frey-ObjectDesigner?class=$package">design</a>| if $package->can('collection'); |
22 |
} |
} |
23 |
} |
} |
24 |
$html .= qq|</td><td>|; |
my @inspect; |
25 |
$html .= qq|<a href="/ob/$package">collection</a>| if $package->can('collection_table'); |
push @inspect, qq|<a href="/Frey-ObjectBrowser?class=$package">collection</a>| if $package->can('collection_table'); |
26 |
$html .= qq|<a href="/markup/$package">markup</a>| if $package->can('markup'); |
foreach my $try ( Frey::Run->execute ) { |
27 |
$html .= qq|<a href="/html/$package">html</a>| if $package->can('html'); |
push @inspect, qq|<a href="/$package/$try">$try</a>| if $package->can($try); |
28 |
$html .= qq|</td></tr>|; |
} |
29 |
|
$html .= qq|</td><td>| . join(' ', @inspect) . qq|</td></tr>|; |
30 |
} |
} |
31 |
$html = "<table>$html</table>" if $html; |
$html = "<table>$html</table>" if $html; |
32 |
$markup = $html; |
$markup = $html; |
33 |
} |
} |
34 |
|
|
|
sub html { |
|
|
my ( $self, $req ) = @_; |
|
|
my $html = $self->page( body => qq|<h1>Classes</h1>| . $self->markup ); |
|
|
$req->print( $html ); |
|
|
} |
|
|
|
|
35 |
1; |
1; |