/[Frey]/trunk/lib/Frey/MapReduce.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/MapReduce.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: 801 byte(s)
make classes immutable and remove moose droppings to make Perl::Critic::Moose happy
1 package Frey::MapReduce;
2 use Moose;
3
4 extends 'Frey';
5 with 'Frey::Web', 'Frey::Storage', 'Frey::File';
6
7 use YAML qw/LoadFile/;
8
9 has path => (
10 is => 'rw',
11 isa => 'Str',
12 required => 1,
13 default => 'var/introspect/',
14 );
15
16 sub as_markup {
17 my ($self) = @_;
18
19 my $introspect;
20
21 my @files = map {
22 my $path = $_;
23 my $data = LoadFile( $path );
24 $data = [ keys %{ $data->{ 'runnable' } } ];
25
26 my $class = $path;
27 $class =~ s{^(.*/)?([^/]+)\.ya?ml$}{$2};
28 $introspect->{ $class } = $data;
29 $_;
30 } $self->dir_extension( $self->path, qr{\.(ya?ml)$} );
31
32 warn "# introspect ", $self->dump( $introspect );
33
34 $self->store('var/Frey/Class/Browser/runnable.yaml', $introspect );
35
36 return $self->dump({
37 files => \@files,
38 introspect => $introspect,
39 });
40 }
41
42 __PACKAGE__->meta->make_immutable;
43 no Moose;
44
45 1;

  ViewVC Help
Powered by ViewVC 1.1.26