--- trunk/lib/Frey/ClassBrowser.pm 2008/07/13 18:51:29 119 +++ trunk/lib/Frey/ClassBrowser.pm 2008/11/05 19:13:01 308 @@ -1,34 +1,34 @@ package Frey::ClassBrowser; use Moose; -with 'Frey::Web'; +extends 'Frey::ClassLoader'; -use Frey::ClassLoader; +use Frey::Run; our $markup; -sub html_markup { +sub markup { my $self = shift; return $markup if $markup; - my $f = Frey::ClassLoader->new; - my $classes = dom2html( - table => [ - map { - my $package = $_; - ( tr => [ - td => [ a => { href => '/~/' . $package, title => $f->package_path( $package ) } => [ $package ] ], - td => [ - $package->can('meta') ? - $package->meta->isa('Moose::Meta::Role') ? 'role' : - ( a => { href => '/od/' . $package } => [ 'design' ] ) : - '' - ], - td => [ $package->can('collection_table') ? ( a => { href => '/ob/' . $package } => [ 'collection' ] ) : '' ], - ] ) - } $f->classes - ], - ); - $markup = $classes; + my $html; + foreach my $class ( $self->classes ) { + $html .= qq|$class|; + if ( $class->can('meta') ) { + if ( $class->meta->isa('Moose::Meta::Role') ) { + $html .= qq|role|; + } else { + $html .= qq|design| if $class->can('collection'); + } + } + my @inspect; + push @inspect, qq|collection| if $class->can('collection_table'); + foreach my $try ( Frey::Run->execute ) { + push @inspect, qq|$try| if $class->can($try); + } + $html .= qq|| . join(' ', @inspect) . qq||; + } + $html = "$html
" if $html; + $markup = $html; } 1;