/[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 1033 by dpavlin, Mon Jan 26 23:30:09 2009 UTC revision 1034 by dpavlin, Tue Feb 3 21:24:02 2009 UTC
# Line 253  sub as_markup { Line 253  sub as_markup {
253    
254          my $path = $self->class_path( $class );          my $path = $self->class_path( $class );
255    
256          my $pod = Frey::Pod->new( class => $class, request_url => $self->request_url )->as_markup;          my ( $pod_toc, $pod ) = Frey::Pod->new( class => $class, request_url => $self->request_url )->as_markup;
257          return $pod if $path =~ m{\.pod};          return $pod_toc . $pod if $path =~ m{\.pod};
258    
259            warn "# ", $pod_toc ? 'toc' : '', ' ', $pod ? 'pod' : '';
260    
261          my $Document = PPI::Document->new( $path );          my $Document = PPI::Document->new( $path );
262    
# Line 288  sub as_markup { Line 290  sub as_markup {
290          $runnable = "<dt>runnable</dt><dd>$runnable</dd>" if $runnable;          $runnable = "<dt>runnable</dt><dd>$runnable</dd>" if $runnable;
291    
292          my $has_tests = '';          my $has_tests = '';
293          my @tests = grep { defined $_ } $self->has_tests;          my @tests = sort { lc($a) cmp lc($b) } grep { defined $_ } $self->has_tests;
294          if ( @tests ) {          if ( @tests ) {
295                  $has_tests                  $has_tests
296                          = qq|<dt>test|                          = qq|<dt>test|
# Line 323  sub as_markup { Line 325  sub as_markup {
325          $self->store( $introspect_path, $introspect );          $self->store( $introspect_path, $introspect );
326    
327          $self->add_css(qq|          $self->add_css(qq|
328                  .right {                  .frey-introspect-right {
329                          position: fixed;                          position: fixed;
330                          top: 1em;                          top: 1em;
331                          right: 1em;                          right: 1em;
# Line 333  sub as_markup { Line 335  sub as_markup {
335                          width: 20%;                          width: 20%;
336                          font-size: 80%;                          font-size: 80%;
337                  }                  }
338                  .right dl dd {                  .frey-introspect-right dl dd {
339                          margin-left: 1em;                          margin-left: 1em;
340                  }                  }
341    
342                    /* fix pod */
343                    .frey-introspect-right dd ul {
344                            padding-left: 0;
345                    }
346                    .frey-introspect-right dl ul > li {
347                            list-style: none;
348                    }
349          |);          |);
350    
351          my $right          my $has_pod = qq|
352                  = qq|                  <dt><a href="#___top" title="Skip to POD">pod</a></dt>
353                          <dl>                  <dd>$pod_toc</dd>
354                          $runnable          | if $pod_toc;
355                          $has_tests  
356                          </dl>          my $has_source = qq|
357                  |                  <dt><a href="#source" title="Skip to source">source</a></dt>
358                  . join('&nbsp;',          | if $source;
359                          $pod    ? qq|<a class="frey-skip" style="float: left;" href="#___top" title="Skip to POD"    >pod</a>|    : '',  
360                          $source ? qq|<a class="frey-skip" style="float: right;" href="#source" title="Skip to source" >source</a>| : ''          my $right = qq|
361                  )                  <dl>
362                  ;                  $runnable
363                    $has_tests
364                    $has_pod
365                    $has_source
366                    </dl>
367            |;
368    
369    
370          return          return
371                  qq|                  qq|
# Line 358  sub as_markup { Line 374  sub as_markup {
374                                  $superclasses $roles                                  $superclasses $roles
375                                  <br>$includes                                  <br>$includes
376                          </div>                          </div>
377                          <div class="right">                          <div class="frey-introspect-right">
378                                  $right                                  $right
379                          </div>                          </div>
380                          $table                          $table

Legend:
Removed from v.1033  
changed lines
  Added in v.1034

  ViewVC Help
Powered by ViewVC 1.1.26