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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 58 - (hide annotations)
Tue Jul 8 12:18:33 2008 UTC (15 years, 9 months ago) by dpavlin
File size: 878 byte(s)
support any level of sub::modules::namespace
1 dpavlin 24 package Frey;
2     use Moose;
3 dpavlin 17
4 dpavlin 24 has 'debug' => (
5     is => 'rw',
6 dpavlin 50 isa => 'Bool',
7 dpavlin 56 default => 0,
8 dpavlin 24 );
9 dpavlin 17
10     =head1 NAME
11    
12     Frey - hi-level web framework in spirit of 4GLs
13    
14     =head1 DESCRIPTION
15    
16     n. Mythology.
17    
18     The Norse god who dispenses peace, good weather, prosperity, and bountiful
19     crops; the brother of Freya.
20    
21     =cut
22    
23 dpavlin 24 use Data::Dump qw/dump/;
24     use File::Find;
25    
26     has 'classes' => (
27     is => 'ro',
28     # isa => 'HashRef[Str]',
29     default => sub {
30     my $self = shift;
31     # FIXME there must be better way to do this in Moose style
32     my $classes;
33     finddepth({ no_chdir => 1, wanted => sub {
34     return unless s/\.pm$//;
35     my @a = split(m!/!,$_);
36     warn ">> $_ ",dump( @a ) if $self->debug;
37 dpavlin 58 my $package = join('::', @a[ 1 .. $#a ]);
38 dpavlin 31 warn "## $package\n";
39 dpavlin 52 push @$classes, { $package => "$_.pm" };
40 dpavlin 24 } }, 'lib');
41     warn "## classes = ",dump( $classes ) if $self->debug;
42     $classes;
43     },
44     lazy => 1,
45     );
46    
47 dpavlin 17 1;

  ViewVC Help
Powered by ViewVC 1.1.26