/[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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.26