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

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

revision 101 by dpavlin, Fri Jul 11 22:54:42 2008 UTC revision 125 by dpavlin, Mon Jul 14 23:12:07 2008 UTC
# Line 7  use Data::Dump qw/dump/; Line 7  use Data::Dump qw/dump/;
7  use File::Find;  use File::Find;
8    
9  our $package_path;  our $package_path;
10    our @classes;
11    
12  sub classes {  sub classes {
13          my $self = shift;          my $self = shift;
14          return keys %$package_path if $package_path;          return @classes if @classes;
15    
16          # FIXME there must be better way to do this in Moose style          # FIXME there must be better way to do this in Moose style
17          finddepth({ no_chdir => 1, wanted => sub {          finddepth({ no_chdir => 1, wanted => sub {
# Line 22  sub classes { Line 23  sub classes {
23          } }, 'lib');          } }, 'lib');
24          warn "## package_path = ",dump( $package_path ) if $self->debug;          warn "## package_path = ",dump( $package_path ) if $self->debug;
25    
26          return keys %$package_path;          @classes = sort keys %$package_path;
27  }  }
28    
29  sub package_path {  sub package_path {
30          my ( $self, $package ) = @_;          my ( $self, $package ) = @_;
31          die "can't find path for package $package" unless defined $package_path->{$package};          $self->classes unless $package_path;
32            confess "can't find path for package $package" unless defined $package_path->{$package};
33          return $package_path->{$package};          return $package_path->{$package};
34  }  }
35    

Legend:
Removed from v.101  
changed lines
  Added in v.125

  ViewVC Help
Powered by ViewVC 1.1.26