/[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 197 by dpavlin, Tue Oct 28 20:46:35 2008 UTC revision 199 by dpavlin, Tue Oct 28 21:47:18 2008 UTC
# Line 155  sub html { Line 155  sub html {
155                                  my $attr = $meta->get_attribute($_);                                  my $attr = $meta->get_attribute($_);
156                                  my ( $before, $title, $after ) = ( '', '', '' );                                  my ( $before, $title, $after ) = ( '', '', '' );
157                                  ( $before, $title, $after ) = ( '<b>', ' title="required"', '</b>' ) if $attr->is_required;                                  ( $before, $title, $after ) = ( '<b>', ' title="required"', '</b>' ) if $attr->is_required;
158  warn $attr->dump;  warn $attr->dump(3);
159                                  foreach my $check ( qw/has_type_constraint has_handles is_weak_ref is_required is_lazy should_coerce should_auto_deref has_trigger has_documentation has_applied_traits/ ) {                                  foreach my $check ( qw/has_type_constraint has_handles is_weak_ref is_required is_lazy should_coerce should_auto_deref has_trigger has_documentation has_applied_traits/ ) {
160                                          my $getter;                                          my $getter;
161                                                                                    
# Line 172  warn $attr->dump; Line 172  warn $attr->dump;
172                                                  }                                                  }
173                                          }                                          }
174                                  }                                  }
175                                  qq|<td>$before<a href="/~/$package/?$_">$_</a></td><td>$after</td>|                                  qq|<td align="right">$before<a href="/~/$package/?$_">$_</a></td><td>$after</td>|
176                          } sort $meta->get_attribute_list                          } sort $meta->get_attribute_list
177                  }                  }
178    
179                  my $table = qq|<table><tr><th>Methods</th><th>Attributes</th><th>Properties</th></tr>|;                  my $table = qq|<table class="frey-object-browser"><tr><th>Methods</th><th align="right">Attributes</th><th align="left">Properties</th></tr>|;
180                  while ( @methods || @attributes ) {                  while ( @methods || @attributes ) {
181                          my ($m,$a) = ( shift @methods, shift @attributes );                          my ($m,$a) = ( shift @methods, shift @attributes );
182                          $m ||= '<td></td>';                          $m ||= '<td></td>';
# Line 195  warn $attr->dump; Line 195  warn $attr->dump;
195                          if ( $meta->superclasses ) {                          if ( $meta->superclasses ) {
196                                  $superclasses = 'Superclasses: ' .                                  $superclasses = 'Superclasses: ' .
197                                          join(', ',                                          join(', ',
198                                                  map { my $s = $_->meta->name; qq|<a href="/~/$s">$s</a>| }                                                  map {
199                                                            my $name = $_->meta->name;
200                                                            qq|<a class="frey-popup" href="/~/$name">$name<span>| . $_->meta->dump(2) . qq|</span></a>|;
201                                                    }
202                                                  #grep { $_ ne 'Moose::Object' }                                                  #grep { $_ ne 'Moose::Object' }
203                                                  $meta->superclasses                                                  $meta->superclasses
204                                          );                                          );
# Line 205  warn $attr->dump; Line 208  warn $attr->dump;
208                  if ( $meta->can('roles') ) {                  if ( $meta->can('roles') ) {
209                          $roles = join(', ',                          $roles = join(', ',
210                                  grep { ! m/\Q$package\E/ }      # skip me                                  grep { ! m/\Q$package\E/ }      # skip me
211                                  map { my $r = $_->name; qq|<a href="/~/$r">$r</a>| }                                  map {
212                                            my $name = $_->name;
213                                            qq|<a class="frey-popup" href="/~/$name">$name<span>| . $name->meta->dump(2) . qq|</span></a>|;
214                                    }
215                                  $meta->calculate_all_roles                                  $meta->calculate_all_roles
216                          );                          );
217                          $roles = " with roles: $roles" if $roles;                          $roles = " with roles: $roles" if $roles;

Legend:
Removed from v.197  
changed lines
  Added in v.199

  ViewVC Help
Powered by ViewVC 1.1.26