[Catalyst-commits] r10336 -
Catalyst-Devel/1.00/branches/helper_refactor/lib/Catalyst
dhoss at dev.catalyst.perl.org
dhoss at dev.catalyst.perl.org
Thu May 28 08:26:39 GMT 2009
Author: dhoss
Date: 2009-05-28 08:26:39 +0000 (Thu, 28 May 2009)
New Revision: 10336
Modified:
Catalyst-Devel/1.00/branches/helper_refactor/lib/Catalyst/Helper.pm
Log:
unfucked get_file
Modified: Catalyst-Devel/1.00/branches/helper_refactor/lib/Catalyst/Helper.pm
===================================================================
--- Catalyst-Devel/1.00/branches/helper_refactor/lib/Catalyst/Helper.pm 2009-05-28 06:51:17 UTC (rev 10335)
+++ Catalyst-Devel/1.00/branches/helper_refactor/lib/Catalyst/Helper.pm 2009-05-28 08:26:39 UTC (rev 10336)
@@ -37,11 +37,22 @@
}
sub get_file {
- my ( $self, $file ) = @_;
-
- return $self->get_sharedir_file($file);
+ my ( $self, $class, $file ) = @_;
+ unless ( $cache{$class} ) {
+ local $/;
+ $cache{$class} = eval "package $class; <DATA>";
+ }
+ my $data = $cache{$class};
+ my @files = split /^__(.+)__\r?\n/m, $data;
+ shift @files;
+ while (@files) {
+ my ( $name, $content ) = splice @files, 0, 2;
+ return $content if $name eq $file;
+ }
+ return 0;
}
+
sub mk_app {
my ( $self, $name ) = @_;
More information about the Catalyst-commits
mailing list