X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FUtils.pm;h=3a9a908a8df7ce163e3564cde34ca89de49a483d;hp=8a2a27b48ea86088c1555c8f24a7b1e8e930f219;hb=74dafab798a163c251e09de7fcc21a267d1678a6;hpb=4be535b191e65b338b0c7d62b7c6acad83f7d455 diff --git a/lib/Catalyst/Utils.pm b/lib/Catalyst/Utils.pm index 8a2a27b..3a9a908 100644 --- a/lib/Catalyst/Utils.pm +++ b/lib/Catalyst/Utils.pm @@ -22,6 +22,19 @@ See L. =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 @@ -83,7 +96,7 @@ sub class2classsuffix { =item class2env($class); -Returns the enviroment name for class. +Returns the environment name for class. MyApp becomes MYAPP My::App becomes MY_APP @@ -211,17 +224,15 @@ sub reflect_actions { return $actions; } -=item request($string); +=item request($request) -Returns an C from a string. +Returns a HTTP::Request object. =cut sub request { my $request = shift; - unless ( ref $request ) { - if ( $request =~ m/http/i ) { $request = URI->new($request)->canonical; } @@ -229,11 +240,9 @@ sub request { $request = URI->new( 'http://localhost' . $request )->canonical; } } - unless ( ref $request eq 'HTTP::Request' ) { $request = HTTP::Request->new( 'GET', $request ); } - return $request; }