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

Diff of /trunk/lib/Frey.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 17 by dpavlin, Sun Jun 29 11:34:17 2008 UTC revision 24 by dpavlin, Sun Jun 29 16:29:09 2008 UTC
# Line 1  Line 1 
1  package Frey  package Frey;
2    use Moose;
3    
4  use strict;  has 'debug' => (
5  use warnings;          is => 'rw',
6            isa => 'Int',
7            default => 1,
8    );
9    
10  =head1 NAME  =head1 NAME
11    
# Line 16  crops; the brother of Freya. Line 20  crops; the brother of Freya.
20    
21  =cut  =cut
22    
23  1;  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                            if ( $#a != 2 ) {
37                                    warn "SKIP $_ [$#a]" if $self->debug;
38                                    return;
39                            }
40                            warn ">> $_ ",dump( @a ) if $self->debug;
41                            warn "## $a[1]::$a[2]\n";
42                            push @$classes, join('::', @a);
43                    } }, 'lib');
44                    warn "## classes = ",dump( $classes ) if $self->debug;
45                    $classes;
46            },
47            lazy => 1,
48    );
49    
50    1;

Legend:
Removed from v.17  
changed lines
  Added in v.24

  ViewVC Help
Powered by ViewVC 1.1.26