--- trunk/lib/Frey/ClassBrowser.pm 2008/11/05 19:13:01 308 +++ trunk/lib/Frey/ClassBrowser.pm 2008/11/18 23:42:40 427 @@ -2,17 +2,19 @@ use Moose; extends 'Frey::ClassLoader'; +with 'Frey::Web'; use Frey::Run; -our $markup; - sub markup { my $self = shift; - return $markup if $markup; - my $html; + my @rows; foreach my $class ( $self->classes ) { - $html .= qq|$class|; + my $html + = qq|$class| + ; if ( $class->can('meta') ) { if ( $class->meta->isa('Moose::Meta::Role') ) { $html .= qq|role|; @@ -20,15 +22,28 @@ $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); + my @run; + my @input; + push @run, qq|collection| if $class->can('collection_table'); + my $class_method = $self->class_methods( $class ); + foreach my $try ( Frey::Run->runnable ) { + next unless $class->can($try); + if ( $class_method->{ $try } ) { + push @run, qq|$try|; + } else { + push @input, $try; + } } - $html .= qq|| . join(' ', @inspect) . qq||; + $html + .= qq|| + . join(' ', @run) + . qq|| + . ( @input ? '← ' . join(' ', @input) : '' ) + . qq|| + ; + push @rows, $html if $html; } - $html = "$html
" if $html; - $markup = $html; + return qq|| . join("\n", @rows) . qq|
| if @rows; } 1;