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

Annotation of /trunk/lib/Frey/INC.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1117 - (hide annotations)
Mon Jun 29 18:52:50 2009 UTC (14 years, 10 months ago) by dpavlin
File size: 775 byte(s)
fix critic
1 dpavlin 540 package Frey::INC;
2     use Moose;
3    
4     extends 'Frey';
5     with 'Frey::Web';
6     with 'Frey::Storage';
7    
8     use Data::Dump qw/dump/;
9    
10     =head1 DESCRIPTION
11    
12     Dump perl's internal C<< %INC >> hash to see which packages are loaded
13    
14     =cut
15    
16 dpavlin 647 #our $html;
17 dpavlin 540
18     sub as_markup {
19     my ( $self ) = @_;
20    
21 dpavlin 647 # return $html if $html;
22     my $html;
23 dpavlin 540
24     my $inc;
25     map {
26     my $class = $_;
27 dpavlin 1117 my $path = $_;
28     $path =~ s{.pm$}{};
29     $path =~ s[/][}->{]g;
30 dpavlin 540 $class =~ s[/][::]g;
31 dpavlin 1117 eval '$inc->{' . $path . '} = $class'; ## no critic
32 dpavlin 540 } sort keys %INC;
33    
34     $html = dump( $inc );
35     $html =~ s{\s+=>\s+\d+}{}gs;
36     $html =~ s{(['"]?)(\w+)\1\s+=>\s+(['"]?)([\w:]*\2)\3}{<a target="$4" href="/$4" title="$4">$2</a>}gs;
37     $html =~ s{\s+=>\s+}{ }gs;
38     $html =~ s{,}{}gs;
39    
40     $self->store( 'var/INC/' . time() . '.html', $html );
41     return $html;
42     }
43    
44     1;

  ViewVC Help
Powered by ViewVC 1.1.26