[Catalyst-commits] r10317 - in Catalyst-Devel/1.00/branches/helper_refactor: lib/Catalyst t

t0m at dev.catalyst.perl.org t0m at dev.catalyst.perl.org
Wed May 27 19:51:45 GMT 2009


Author: t0m
Date: 2009-05-27 19:51:45 +0000 (Wed, 27 May 2009)
New Revision: 10317

Modified:
   Catalyst-Devel/1.00/branches/helper_refactor/lib/Catalyst/Helper.pm
   Catalyst-Devel/1.00/branches/helper_refactor/t/create_files.t
Log:
Fix not generating any files by: svn merge -r 10313:10310 .

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-27 19:47:11 UTC (rev 10316)
+++ Catalyst-Devel/1.00/branches/helper_refactor/lib/Catalyst/Helper.pm	2009-05-27 19:51:45 UTC (rev 10317)
@@ -2,6 +2,7 @@
 
 use strict;
 use warnings;
+use base 'Class::Accessor::Fast';
 use Config;
 use File::Spec;
 use File::Path;
@@ -12,13 +13,7 @@
 use Catalyst::Devel;
 use Catalyst::Utils;
 use Catalyst::Exception;
-use Moose;
-use File::ShareDir qw/dist_dir/;
-use Path::Class qw/file dir/;
-#use Method::Signatures::Simple;
-#use namespace::autoclean;
 
-
 my %cache;
 
 =head1 NAME
@@ -38,7 +33,7 @@
         $cache{$class} = eval "package $class; <DATA>";
     }
     my $data = $cache{$class};
-    my @files = $self->get_files;
+    my @files = split /^__(.+)__\r?\n/m, $data;
     shift @files;
     while (@files) {
         my ( $name, $content ) = splice @files, 0, 2;
@@ -462,55 +457,6 @@
     }
 }
 
-
-=head2 get_version_dir
-get the version of the dist specified and return a Path::Class::Dir object
-=cut
-
-sub get_version_dir {
-    my ( $self, $version ) = @_;
-    
-    return dir( dist_dir('Catalyst-Devel'), $version );
-    
-}
-
-=head2 get_files
-
-open up our File::ShareDir directory, loop through, and get our template files
-
-=cut
-
-sub get_template_files {
-    my ($self, $version) = @_;
-    
-    my $dir = $self->get_version_dir($version);
-    
-    my $dh = $dir->open or die "Can't open: $!";
-    my @files = ();
-    # get everything with a .tt/.tt2 extension
-    while (my $file = $dh->read) {
-        $file = $dir->file($file);  # Turn into Path::Class::File object
-        
-        #if ( $file =~ /\.(tt|tt2)$/ ) {
-        #    push @files, $file;
-        #}
-    }
-    
-    return @files;
-
-}
-
-=head2 get_fielss
-
-get all of our files, so get_file doesn't break
-
-=cut
-sub get_files {
-    my ( $self, $version, $name ) = shift;
-    my $dir = $self->get_version_dir($version);
-    return file($dir, $name);
-}
-
 =head1 DESCRIPTION
 
 This module is used by B<catalyst.pl> to create a set of scripts for a

Modified: Catalyst-Devel/1.00/branches/helper_refactor/t/create_files.t
===================================================================
--- Catalyst-Devel/1.00/branches/helper_refactor/t/create_files.t	2009-05-27 19:47:11 UTC (rev 10316)
+++ Catalyst-Devel/1.00/branches/helper_refactor/t/create_files.t	2009-05-27 19:51:45 UTC (rev 10317)
@@ -3,7 +3,7 @@
 
 use FindBin qw/$Bin/;
 
-use Test::More tests => 0;
+use Test::More tests => 1;
 
 use Catalyst::Helper;
 




More information about the Catalyst-commits mailing list