/[Frey]/trunk/lib/Frey/Introspect.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/Introspect.pm

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

revision 133 by dpavlin, Tue Jul 15 13:58:07 2008 UTC revision 134 by dpavlin, Tue Jul 15 14:56:28 2008 UTC
# Line 150  sub html { Line 150  sub html {
150                  @attributes = map {                  @attributes = map {
151                                  my $attr = $class->get_attribute($_);                                  my $attr = $class->get_attribute($_);
152                                  my ( $before, $title, $after ) = ( '', '', '' );                                  my ( $before, $title, $after ) = ( '', '', '' );
153                                  ( $before, $title, $after ) = ( '<b>', ' title="required"', '</b>' ) if $attr->is_required;                                  ( $before, $title, $after ) = ( '<b>', ' title="required"', '</b>' ) if $attr->can('is_required') && $attr->is_required;
154                                  qq|<td>$before<a href="/~/$package/$_?"$title>$_</a>$after</td>|                                  qq|<td>$before<a href="/~/$package/$_?"$title>$_</a>$after</td>|
155                          } sort $class->get_attribute_list                          } sort $class->get_attribute_list
156                  }                  }
# Line 173  sub html { Line 173  sub html {
173    
174                  warn "## css = ",dump( $self->css );                  warn "## css = ",dump( $self->css );
175    
176                  my $superclasses = 'Role';                  my ( $superclasses, $roles ) = ( '', 'Role' );
177                  $superclasses = 'Superclasses: ' . join(', ',                  if ( ! $is_role ) {
178                          map {                          if ( $meta->superclasses ) {
179                                  my $s = $_->meta->name;                                  $superclasses = 'Superclasses: ' .
180                                  qq|<a href="/~/$s">$s</a>|                                          join(', ',
181                                                    map { my $s = $_->meta->name; qq|<a href="/~/$s">$s</a>| }
182                                                    #grep { $_ ne 'Moose::Object' }
183                                                    $meta->superclasses
184                                            );
185                          }                          }
186                          #grep { $_ ne 'Moose::Object' }  
187                          $meta->superclasses                          if ( $meta->can('roles') ) {
188                  ) if ! $is_role && $meta->superclasses;                                  $roles = join(', ', map { my $r = $_->name; qq|<a href="/~/$r">$r</a>| } @{ $meta->roles } );
189                                    $roles = " with roles: $roles" if $roles;
190                            }
191                    }
192    
193                  my $pod = Frey::Pod->new( class => $package )->markup;                  my $pod = Frey::Pod->new( class => $package )->markup;
194    
195                  my $html = $self->page(                  my $html = $self->page(
196                          title => "Introspect $package",                          title => "Introspect $package",
197                          body => qq|<h1>$package</h1>|                          body => qq|<h1>$package</h1>|
198                                  . ( $pod ? qq|<a href="#___top" title="Skip to POD" style="font-size: 80%; color: #aaa;">&darr;pod&darr</a>  | : '' )                                  . qq|$superclasses\n$roles\n|
199                                  . qq|$superclasses\n$table\n$pod\n$classes|,                                  . ( $pod ? qq|<a href="#___top" title="Skip to POD" style="font-size: 80%; color: #aaa;">&darr;pod&darr</a>| : '' )
200                                    . qq|$table\n$pod\n$classes|,
201    
202                  );                  );
203    

Legend:
Removed from v.133  
changed lines
  Added in v.134

  ViewVC Help
Powered by ViewVC 1.1.26