Catalyst-Plugin-SmartURI

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
    - improved request class, better Host header parsing, fixed POD.
 
0.025  2008-06-28 08:33:57
    - fucked up the pod for SYNOPSIS...
 
0.024  2008-06-28 03:01:53
    - added 'host-header' disposition.
    - converted conf key to 'Plugin::SmartURI'
 
0.023  2008-06-28 01:14:49
    - weaken saved context.
 
0.022  2008-06-24 16:52:55
    - fix weird bug with initialization that sometimes happens.
 
0.021  2008-06-16 22:20:42
    - minor speedup, avoiding unnecessary string evals.
 
0.02  2008-06-03 21:58:17
    - moved Catalyst::SmartURI into a separate dist as URI::SmartURI

lib/Catalyst/Plugin/SmartURI.pm  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
our $AUTHORITY = 'cpan:RKITOVER';
$Catalyst::Plugin::SmartURI::VERSION = '0.041';
use Moose;
use mro 'c3';
 
use 5.008001;
use Scalar::Util 'weaken';
use Class::Load ();
 
use namespace::clean -except => 'meta';
 
has uri_disposition => (is => 'rw', isa => 'Str');
has uri_class       => (is => 'rw', isa => 'Str');
 
my $context; # keep a weakend copy for the Request class to use
 
my ($conf_disposition, $conf_uri_class); # configured values
 
=head1 NAME
 
Catalyst::Plugin::SmartURI - Configurable URIs for Catalyst
 
=head1 SYNOPSIS
 
In your lib/MyApp.pm, load the plugin and your other plugins, for example:

lib/Catalyst/Plugin/SmartURI.pm  view on Meta::CPAN

281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
    $res
}
 
# Reset accessors to configured values at beginning of request.
sub prepare {
    my $app = shift;
 
# Also save a copy of the context for the Request class to use.
    my $c = $context = $app->next::method(@_);
    weaken $context;
 
    $c->uri_class($conf_uri_class);
    $c->uri_disposition($conf_disposition);
 
    $c
}
 
__PACKAGE__->meta->make_immutable;
 
=head1 SEE ALSO



( run in 0.245 second using v1.01-cache-2.11-cpan-cba739cd03b )