[Catalyst-commits] r7579 - in Catalyst-Plugin-SmartURI/1.000/trunk: . lib/Catalyst lib/Catalyst/Plugin

caelum at dev.catalyst.perl.org caelum at dev.catalyst.perl.org
Mon Apr 7 09:59:49 BST 2008


Author: caelum
Date: 2008-04-07 09:59:49 +0100 (Mon, 07 Apr 2008)
New Revision: 7579

Modified:
   Catalyst-Plugin-SmartURI/1.000/trunk/META.yml
   Catalyst-Plugin-SmartURI/1.000/trunk/lib/Catalyst/Plugin/SmartURI.pm
   Catalyst-Plugin-SmartURI/1.000/trunk/lib/Catalyst/SmartURI.pm
Log:
Minor changes, will release tomorrow.


Modified: Catalyst-Plugin-SmartURI/1.000/trunk/META.yml
===================================================================
--- Catalyst-Plugin-SmartURI/1.000/trunk/META.yml	2008-04-06 21:19:17 UTC (rev 7578)
+++ Catalyst-Plugin-SmartURI/1.000/trunk/META.yml	2008-04-07 08:59:49 UTC (rev 7579)
@@ -24,4 +24,4 @@
   List::MoreUtils: 0
   List::Util: 0
 tests: 't/*.t t/*/*.t'
-version: 0.01_01
+version: 0.01

Modified: Catalyst-Plugin-SmartURI/1.000/trunk/lib/Catalyst/Plugin/SmartURI.pm
===================================================================
--- Catalyst-Plugin-SmartURI/1.000/trunk/lib/Catalyst/Plugin/SmartURI.pm	2008-04-06 21:19:17 UTC (rev 7578)
+++ Catalyst-Plugin-SmartURI/1.000/trunk/lib/Catalyst/Plugin/SmartURI.pm	2008-04-07 08:59:49 UTC (rev 7579)
@@ -10,11 +10,11 @@
 
 =head1 VERSION
 
-Version 0.01_01
+Version 0.01
 
 =cut
 
-our $VERSION = '0.01_01';
+our $VERSION = '0.01';
 
 =head1 SYNOPSIS
 
@@ -43,7 +43,7 @@
 uri_class, or write a class that follows the same interface.
 
 This plugin installs a custom $c->request_class, however it does so in a way
-that won't break if you've already set your own request_class.
+that won't break if you've already set $c->request_class yourself (thanks mst!).
 
 There will be a slight performance penalty for your first few requests, due to
 the way L<Catalyst::SmartURI> works, but after that you shouldn't notice
@@ -78,8 +78,8 @@
     sub begin : Private {
         my ($self, $c) = @_;
 
-        $c->uri_class('Your::URI::Class'); # if you need
-        $c->uri_disposition('absolute'); # rest of app configured differently
+        $c->uri_class('Your::URI::Class::For::Request');
+        $c->uri_disposition('absolute');
     }
 
 =over
@@ -173,6 +173,10 @@
     $c
 }
 
+=head1 SEE ALSO
+
+L<Catalyst::SmartURI>, L<Catalyst>, L<URI>
+
 =head1 AUTHOR
 
 Rafael Kitover, C<< <rkitover at cpan.org> >>
@@ -219,9 +223,16 @@
 from #catalyst:
 
 vipul came up with the idea
+
 mst came up with the design and implementation details for the current version
+
 kd reviewed my code and offered suggestions
 
+=head1 TODO
+
+I'd like to extend on L<Catalyst::Plugin::RequireSSL>, and make a plugin that
+rewrites URIs for actions with an SSL attribute.
+
 =head1 COPYRIGHT & LICENSE
 
 Copyright (c) 2008 Rafael Kitover

Modified: Catalyst-Plugin-SmartURI/1.000/trunk/lib/Catalyst/SmartURI.pm
===================================================================
--- Catalyst-Plugin-SmartURI/1.000/trunk/lib/Catalyst/SmartURI.pm	2008-04-06 21:19:17 UTC (rev 7578)
+++ Catalyst-Plugin-SmartURI/1.000/trunk/lib/Catalyst/SmartURI.pm	2008-04-07 08:59:49 UTC (rev 7579)
@@ -74,7 +74,8 @@
 
 The object returned will be blessed into a scheme-specific subclass, based on
 the class of the underlying $uri->obj (L<URI> object.) For example,
-Catalyst::SmartURI::http, and this class derives from the L<Catalyst::SmartURI>.
+Catalyst::SmartURI::http, which derives from L<Catalyst::SmartURI> (or
+$uri->factory_class if you're subclassing.)
 
 =cut
 
@@ -138,7 +139,7 @@
 sub hostless {
     my $uri = $_[0]->clone;
 
-    my $scheme = $uri->scheme('');
+    $uri->scheme('');
     $uri->host('');
     $uri->port('');
 
@@ -268,8 +269,6 @@
 
     return unless $_[0] && $_[0] eq '-import_uri_mods';
 
-    return if ${$class.'::__INITIALIZED__'};
-
 # File::Find::Rule is not taint safe, and Module::Starter suggests running
 # tests in taint mode. Thanks for helping me with this one Somni!!!
     {
@@ -306,14 +305,12 @@
     };
 
     Class::C3::reinitialize;
-
-    ${$class.'::__INITIALIZED__'} = 1;
 }
 
 =head1 INTERNAL METHODS
 
 These are used internally by SmartURI, and are not interesting for general use,
-maybe for subclassing purposes.
+but may be useful for writing subclasses.
 
 =head2 $uri->_opts
 
@@ -472,11 +469,20 @@
     use Catalyst::SmartURI '-import_uri_mods';
     use Catalyst::SmartURI::Escape qw(%escapes);
 
-It even works with a subclass of Catalyst::SmartURI.
+It even works with a subclass of L<Catalyst::SmartURI>.
 
 I only wrote this functionality so that I could run the URI test suite without
 much modification, it has no real practical value.
 
+=head1 SEE ALSO
+
+L<Catalyst::Plugin::SmartURI>, L<URI>, L<URI::WithBase>, L<Catalyst>
+
+=head1 ACKNOWLEDGEMENTS
+
+Thanks to folks on freenode #perl for helping me out when I was getting stuck,
+Somni, reverend, PerlJam and others whose nicks I forget.
+
 =head1 AUTHOR
 
 Rafael Kitover, C<< <rkitover at cpan.org> >>




More information about the Catalyst-commits mailing list