/[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 458 by dpavlin, Wed Nov 19 17:05:59 2008 UTC revision 534 by dpavlin, Wed Nov 26 07:58:40 2008 UTC
# Line 13  use PPI::HTML; Line 13  use PPI::HTML;
13    
14  use lib 'lib';  use lib 'lib';
15    
16  extends 'Frey::ClassLoader';  extends 'Frey::PPI';
17  with 'Frey::Web';  with 'Frey::Web';
18    
19  has 'class' => (  has 'class' => (
# Line 22  has 'class' => ( Line 22  has 'class' => (
22          required => 1,          required => 1,
23  );  );
24    
 has 'path' => (  
         is => 'rw',  
 );  
   
25  =head2 joose  =head2 joose
26    
27    my $js = $o->joose;    my $js = $o->joose;
# Line 98  sub joose { Line 94  sub joose {
94          my $path = "static/blib/$filename";          my $path = "static/blib/$filename";
95          write_file( $path, $out );          write_file( $path, $out );
96          warn "# created $path\n";          warn "# created $path\n";
         $self->path( $path );  
97    
98          return $out;          return $out;
99  }  }
# Line 228  sub as_markup { Line 223  sub as_markup {
223  #       $source =~ s{^.*<body[^>]+>}{}s;  #       $source =~ s{^.*<body[^>]+>}{}s;
224  #       $source =~ s{</body.*$}{}s;  #       $source =~ s{</body.*$}{}s;
225    
   
226          my $runnable = join("\n",          my $runnable = join("\n",
227                  map {                  map {
228                          qq|<a href="/$class/$_">$_</a>|                          qq|<a target="$class" href="/$class/$_">$_</a>|
229                  } $self->class_runnable( $class )                  } $self->class_runnable( $class )
230          );          );
231          $runnable = " runnable: $runnable" if $runnable;          $runnable = " runnable: $runnable" if $runnable;
232    
233          $self->title( $class );          $self->title( $class );
234    
235            my $has_tests = '';
236            if ( my @tests = $self->has_tests ) {
237                    $has_tests =
238                    '<br/>test' . ( $#tests > 0 ? 's' : '' ) . ': ' .      
239                    join("\n", map {
240                            qq|<a target="$class" href="/Frey::Test::Runner/as_markup?test=$_">$_</a>|
241                    } @tests );
242            }
243    
244          return join("\n",          return join("\n",
245                  qq|<h1>$class</h1>|,                  qq|<h1>$class</h1>|,
246                  qq|<div class="frey-introspect">$superclasses\n$roles\n$runnable\n|,                  qq|<div class="frey-introspect">$superclasses\n$roles\n$runnable\n|,
247                  $pod    ? qq|<a class="frey-skip" href="#___top" title="Skip to POD"    >pod</a>|    : '',                  $pod    ? qq|<a class="frey-skip" href="#___top" title="Skip to POD"    >pod</a>|    : '',
248                  $source ? qq|<a class="frey-skip" href="#source" title="Skip to source" >source</a>| : '',                  $source ? qq|<a class="frey-skip" href="#source" title="Skip to source" >source</a>| : '',
249                    $has_tests,
250                  qq|$table\n$pod\n</div>\n|,                  qq|$table\n$pod\n</div>\n|,
251                  qq|<h1>Source</h1><a name="source"></a><div class="frey-source">$source</div>|,                  qq|<h1>Source</h1><a name="source"></a><div class="frey-source">$source</div>|,
252          );          );

Legend:
Removed from v.458  
changed lines
  Added in v.534

  ViewVC Help
Powered by ViewVC 1.1.26