/[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 331 by dpavlin, Sat Nov 8 16:12:39 2008 UTC revision 382 by dpavlin, Mon Nov 17 19:21:06 2008 UTC
# Line 17  our @classes; Line 17  our @classes;
17    
18  =head2 classes  =head2 classes
19    
20    Return all local classes by reading from disk
21    
22    my @classes = $o->classes;    my @classes = $o->classes;
23    
24  =cut  =cut
# Line 40  sub classes { Line 42  sub classes {
42    
43  =head2 class_path  =head2 class_path
44    
45    Return any local or loaded class
46    
47    $path = $o->class_path( $class );    $path = $o->class_path( $class );
48    
49  =cut  =cut
# Line 47  sub classes { Line 51  sub classes {
51  sub class_path {  sub class_path {
52          my ( $self, $class ) = @_;          my ( $self, $class ) = @_;
53          $self->classes unless $class_path;          $self->classes unless $class_path;
54          confess "can't find path for class $class" unless defined $class_path->{$class};          if ( ! defined $class_path->{$class} ) {
55                    my $path = $class;
56                    $path =~ s{::}{/}g;
57                    $path .= '.pm';
58                    $path = $INC{$path};
59                    warn "# $class from INC $path";
60                    $class_path->{$class} = $path;
61            }
62          return $class_path->{$class};          return $class_path->{$class};
63  }  }
64    

Legend:
Removed from v.331  
changed lines
  Added in v.382

  ViewVC Help
Powered by ViewVC 1.1.26