Fixed pod and added Catalyst::Utils::appprefix
Sebastian Riedel [Fri, 21 Oct 2005 12:45:56 +0000 (12:45 +0000)]
lib/Catalyst.pm
lib/Catalyst/Build.pm
lib/Catalyst/Engine/Test.pm
lib/Catalyst/Helper.pm
lib/Catalyst/Utils.pm

index 0d2f091..86886b0 100644 (file)
@@ -1681,7 +1681,7 @@ Sebastian Riedel, C<sri@oook.de>
 =head1 LICENSE
 
 This library is free software . You can redistribute it and/or modify it under
-the same terms as perl itself.
+the same terms as Perl itself.
 
 =cut
 
index d37840e..47be034 100644 (file)
@@ -97,8 +97,8 @@ Sebastian Riedel, C<sri@oook.de>
 
 =head1 LICENSE
 
-This library is free software . You can redistribute it and/or modify it under
-the same terms as perl itself.
+This library is free software, you can redistribute it and/or modify it under
+the same terms as Perl itself.
 
 =cut
 
index 8173bde..5dd0523 100644 (file)
@@ -2,7 +2,7 @@ package Catalyst::Engine::Test;
 
 use strict;
 use base 'Catalyst::Engine::CGI';
-use Catalyst::Utils;
+use HTTP::Request;
 use HTTP::Response;
 use HTTP::Status;
 use NEXT;
@@ -58,7 +58,18 @@ sub finalize_headers {
 sub run {
     my ( $self, $class, $request ) = @_;
 
-    $request = Catalyst::Utils::request($request);
+    # Construct request
+    unless ( ref $request ) {
+        if ( $request =~ m/http/i ) {
+            $request = URI->new($request)->canonical;
+        }
+        else {
+            $request = URI->new( 'http://localhost' . $request )->canonical;
+        }
+    }
+    unless ( ref $request eq 'HTTP::Request' ) {
+        $request = HTTP::Request->new( 'GET', $request );
+    }
 
     $request->header(
         'Host' => sprintf( '%s:%d', $request->uri->host, $request->uri->port )
index 2ae3996..c31df67 100644 (file)
@@ -9,6 +9,7 @@ use IO::File;
 use FindBin;
 use Template;
 use Catalyst;
+use Catalyst::Utils;
 use Catalyst::Exception;
 
 my %cache;
@@ -61,8 +62,7 @@ sub mk_app {
     $self->{name} = $name;
     $self->{dir}  = $name;
     $self->{dir} =~ s/\:\:/-/g;
-    $self->{appprefix} = lc $self->{dir};
-    $self->{appprefix} =~ s/-/_/g;
+    $self->{appprefix} = Catalyst::Utils::appprefix($name);
     $self->{startperl} = $Config{startperl};
     $self->{scriptgen} = $Catalyst::CATALYST_SCRIPT_GEN || 4;
     $self->{author}    = $self->{author} = $ENV{'AUTHOR'}
@@ -449,8 +449,8 @@ Sebastian Riedel, C<sri@oook.de>
 
 =head1 LICENSE
 
-This library is free software . You can redistribute it and/or modify
-it under the same terms as perl itself.
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
 
 =cut
 
@@ -522,8 +522,8 @@ sub default : Private {
 
 =head1 LICENSE
 
-This library is free software . You can redistribute it and/or modify
-it under the same terms as perl itself.
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
 
 =cut
 
@@ -633,8 +633,8 @@ Sebastian Riedel, C<sri@oook.de>
 
 Copyright 2004 Sebastian Riedel. All rights reserved.
 
-This library is free software. You can redistribute it and/or modify
-it under the same terms as perl itself.
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
 
 =cut
 __fastcgi__
@@ -671,8 +671,8 @@ Sebastian Riedel, C<sri@oook.de>
 
 Copyright 2004 Sebastian Riedel. All rights reserved.
 
-This library is free software. You can redistribute it and/or modify
-it under the same terms as perl itself.
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
 
 =cut
 __server__
@@ -759,8 +759,8 @@ Sebastian Riedel, C<sri@oook.de>
 
 Copyright 2004 Sebastian Riedel. All rights reserved.
 
-This library is free software. You can redistribute it and/or modify
-it under the same terms as perl itself.
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
 
 =cut
 __test__
@@ -816,8 +816,8 @@ Sebastian Riedel, C<sri@oook.de>
 
 Copyright 2004 Sebastian Riedel. All rights reserved.
 
-This library is free software. You can redistribute it and/or modify
-it under the same terms as perl itself.
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
 
 =cut
 __create__
@@ -882,8 +882,8 @@ Sebastian Riedel, C<sri\@oook.de>
 
 Copyright 2004 Sebastian Riedel. All rights reserved.
 
-This library is free software. You can redistribute it and/or modify
-it under the same terms as perl itself.
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
 
 =cut
 __compclass__
@@ -929,8 +929,8 @@ Catalyst component.
 
 =head1 LICENSE
 
-This library is free software . You can redistribute it and/or modify
-it under the same terms as perl itself.
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
 
 =cut
 
index c4d9ca8..c76a247 100644 (file)
@@ -22,6 +22,19 @@ See L<Catalyst>.
 
 =over 4
 
+=item appprefix($class)
+
+Returns the application prefix for the class
+
+=cut
+
+sub appprefix {
+    my $class = shift;
+    $class =~ s/\:\:/_/g;
+    $class = lc($class);
+    return $class;
+}
+
 =item attrs($coderef)
 
 Returns attributes for coderef in a arrayref
@@ -211,32 +224,6 @@ sub reflect_actions {
     return $actions;
 }
 
-=item request($string);
-
-Returns an C<HTTP::Request> from a string.
-
-=cut
-
-sub request {
-    my $request = shift;
-
-    unless ( ref $request ) {
-
-        if ( $request =~ m/http/i ) {
-            $request = URI->new($request)->canonical;
-        }
-        else {
-            $request = URI->new( 'http://localhost' . $request )->canonical;
-        }
-    }
-
-    unless ( ref $request eq 'HTTP::Request' ) {
-        $request = HTTP::Request->new( 'GET', $request );
-    }
-
-    return $request;
-}
-
 =back
 
 =head1 AUTHOR