Parent Directory | Revision Log
with Mojo we really load packages on demand so we can't cache output
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 | s{.pm$}{}; | ||
27 | my $class = $_; | ||
28 | s[/][}->{]g; | ||
29 | $class =~ s[/][::]g; | ||
30 | eval '$inc->{' . $_ . '} = $class'; | ||
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 | 1; |
ViewVC Help | |
Powered by ViewVC 1.1.26 |