/[Frey]/trunk/lib/Frey/Class/Browser.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

Diff of /trunk/lib/Frey/Class/Browser.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 821 by dpavlin, Fri Dec 12 18:02:39 2008 UTC revision 1127 by dpavlin, Tue Jun 30 14:07:10 2009 UTC
# Line 1  Line 1 
1  package Frey::Class::Browser;  package Frey::Class::Browser;
2  use Moose;  use Moose;
3    
4    use lib 'lib';
5    
6  extends 'Frey::Class::Loader';  extends 'Frey::Class::Loader';
7  with 'Frey::Web';  with 'Frey::Web';
8  with 'Frey::Session';  with 'Frey::Session';
9  with 'Frey::Web::CombineImages';  with 'Frey::Web::CombineImages';
10    with 'Frey::Class::Icon';
11    
 use Frey::Run;  
12  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
13    
14  has 'usage_sort' => (  has 'usage_sort' => (
# Line 33  sub as_markup { Line 35  sub as_markup {
35          $usage ||= $self->session_dump( $self->usage );          $usage ||= $self->session_dump( $self->usage );
36          #warn "# usage ",dump( $usage );          #warn "# usage ",dump( $usage );
37    
         if ( ! $self->can('icon_path') ) {  
                 $self->TODO( "re-apply Frey::Web on $self" );  
                 Frey::Web->meta->apply( $self );  
         }  
   
38          my $runnable = $self->load('var/Frey/Class/Browser/runnable.yaml');          my $runnable = $self->load('var/Frey/Class/Browser/runnable.yaml');
39    
40          foreach my $class ( $self->classes ) {          foreach my $class ( $self->classes ) {
41    
42                  my $icon = $self->icon_path( $class );                  my $icon = $self->icon_path( $class );
43    
44                  if ($icon) {                  if ($icon) {
45                          push @icons, $icon;                          push @icons, $icon;
46                          $icon = qq|<!-- icon:$icon -->|;                          $icon = qq|<!-- icon:$icon -->|;
# Line 53  sub as_markup { Line 51  sub as_markup {
51                  my $html                  my $html
52                          = qq|<tr><td>$icon</td><td><a target="$class" href="/$class" title="|                          = qq|<tr><td>$icon</td><td><a target="$class" href="/$class" title="|
53                          . $self->class_path( $class )                          . $self->class_path( $class )
54                          . qq|">$class</a></td><td>|                          . qq|">$class</a>
55                            <a target="Frey::Class::Graph" title="show class graph" href="/Frey::Class::Graph/as_markup?filter=$class&filter_class=1&filter_extends=0&filter_includes=0&filter_roles=0&show_extends=1&show_includes=1&show_roles=1&layout=dot" class="graph">&#x260D;</a>
56                            </td><td>|
57                          ;                          ;
58                  if ( $class->can('meta') ) {                  if ( $class->can('meta') ) {
59                          if ( $class->meta->isa('Moose::Meta::Role') ) {                          if ( $class->meta->isa('Moose::Meta::Role') ) {
# Line 63  sub as_markup { Line 63  sub as_markup {
63                          }                          }
64                  }                  }
65    
66                  my @runnable = @{ $runnable->{ $class } } if defined $runnable->{ $class };                  my @runnable = ();
67                    @runnable = @{ $runnable->{ $class } } if defined $runnable->{ $class }; # FIXME needs review
68                  @runnable = $self->class_runnable( $class ) unless @runnable;                  @runnable = $self->class_runnable( $class ) unless @runnable;
69    
70                  my @run = map {                  my @run = map {
# Line 95  sub as_markup { Line 96  sub as_markup {
96                  $icons_html->{ $path } || die "can't find $path in ",dump($icons_html);                  $icons_html->{ $path } || die "can't find $path in ",dump($icons_html);
97          };          };
98    
99            eval {
100    
101          $self->title('Frey');          $self->title('Frey');
102    
103            $self->add_css(qq|
104                    a.graph {
105                            color: #888;
106                            text-decoration: none;
107                    }
108            |);
109    
110            };
111            warn "FIXME: $@" if $@;
112    
113          return          return
114                  qq|<table>| . join("\n",                  qq|<table>| . join("\n",
115                          map {                          map {

Legend:
Removed from v.821  
changed lines
  Added in v.1127

  ViewVC Help
Powered by ViewVC 1.1.26