blib/lib/URI/SmartURI.pm

filter: Statementstmt 91.1% 176 / 193 Branchbran 76.0% 38 / 50 Conditioncond 57.1% 16 / 28 MC/DCmcdc 37.5% 6 / 16 Subroutinesub 89.3% 42 / 47 Podpod 77.7% 7 / 9 totaltotal 83.0% 285 / 343 CC 38 SCAR 12.0
CC
38
Cov
85%
url
9.8
_inflate_uris
6.2
AUTOLOAD
6.1
CRAP 3.3
↑ Summary
1 package URI::SmartURI;
2  
3 2 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use mro 'c3';
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 =head1 NAME
7  
8 URI::SmartURI - Subclassable and hostless URIs
9  
10 =head1 VERSION
11  
12 Version 0.032
13  
14 =cut
15  
16 2 our $VERSION = '0.032';
17  
18 =head1 SYNOPSIS
19  
20 my $uri = URI::SmartURI->new(
21 'http://host/foo/',
22 { reference => 'http://host/bar/' }
23 );
24  
25 my $hostless = $uri->hostless; # '/foo/'
26  
27 $hostless->absolute; # 'http://host/foo/'
28  
29 $uri->relative; # '../foo/'
30  
31 =cut
32  
33 2 ▶use URI;
Subroutine BEGIN: called CC=1 SCAR=0.0
34 2 ▶use URI::URL;
Subroutine BEGIN: called CC=1 SCAR=0.0
35 2 ▶use URI::QueryParam;
Subroutine BEGIN: called CC=1 SCAR=0.0
36 2 ▶use File::Find::Rule;
Subroutine BEGIN: called CC=1 SCAR=0.0
37 2 ▶use File::Spec::Functions qw/splitpath splitdir catfile catpath/;
Subroutine BEGIN: called CC=1 SCAR=0.0
38 2 ▶use List::MoreUtils 'firstidx';
Subroutine BEGIN: called CC=1 SCAR=0.0
39 2 ▶use Scalar::Util 'blessed';
Subroutine BEGIN: called CC=1 SCAR=0.0
40 2 ▶use List::Util 'first';
Subroutine BEGIN: called CC=1 SCAR=0.0
41 2 ▶use Exporter ();
Subroutine BEGIN: called CC=1 SCAR=0.0
42 2 ▶use Class::C3::Componentised;
Subroutine BEGIN: called CC=1 SCAR=0.0
43  
44 2 ▶use namespace::clean -except => 'meta';
Subroutine BEGIN: called CC=1 SCAR=0.0
45  
46 2 has 'obj' => (is => 'ro', isa => 'Object');
47 2 has 'factory_class' => (is => 'ro', isa => 'ClassName');
48 2 has 'reference' => (is => 'rw', isa => 'Maybe[Str]');
49  
50 =head1 DESCRIPTION
51  
52 This is a sort of "subclass" of L<URI> using delegation with some extra methods,
53 all the methods that work for L<URI>s will work on these objects as well.
54  
55 It's similar in spirit to L<URI::WithBase>.
56  
57 It's also completely safe to subclass for your own use.
58  
59 =head1 CONSTRUCTORS
60  
61 =head2 URI::SmartURI->new($str,
62 [$scheme|{reference => $ref, scheme => $scheme}])
63  
64 Takes a uri $str and an optional scheme or hashref with a reference uri
65 (for computing relative/absolute URIs) and an optional scheme.
66  
67 my $uri = URI::SmartURI->new('http://dev.catalyst.perl.org/');
68  
69 my $uri = URI::SmartURI->new('/dev.catalyst.perl.org/new-wiki/', 'http');
70  
71 my $uri = URI::SmartURI->new(
72 'http://search.cpan.org/~jrockway/Catalyst-Manual-5.701003/',
73 { reference => 'http://search.cpan.org/' }
74 );
75  
76 The object returned will be blessed into a scheme-specific subclass, based on
77 the class of the underlying $uri->obj (L<URI> object.) For example,
78 URI::SmartURI::http, which derives from L<URI::SmartURI> (or
79 $uri->factory_class if you're subclassing.)
80  
81 =cut
82  
83 8 ▶sub new {
Subroutine new: called CC=3 SCAR=11.0
Pod documented
84 8 my ($class, $uri, $opts) = @_;
85  
86 8 ▶ $opts = { scheme => $opts }
Branch: 1 branch
BranchTrueFalseTotal
unless ref $opts and ref $opts eq "HASH" 1 7 8
Condition66%2/3
ref $opts and ref $opts eq "HASH"
!ll&&!rl&&r
107
MC/DC50%1/2
ref $opts and ref $opts eq "HASH"
ref $opts ref $opts eq "HASH"
Truth table66%2/3
A and B
A= ref $optsB= ref $opts eq "HASH"
ABresult
0X0
100
111
87 unless ref($opts) && ref($opts) eq 'HASH';
88  
89 my $self = {
90 obj => URI->new($class->_deflate_uris($uri, $opts->{scheme})),
91 reference => $opts->{reference},
92 8 factory_class => $class
93 };
94  
95 8 bless $self, $class->_make_uri_class(blessed $self->{obj}, 1);
96 }
97  
98 =head2 URI::SmartURI->new_abs($str, $base_uri)
99  
100 Proxy for L<URI>->new_abs
101  
102 =cut
103  
104 0 ▶sub new_abs {
Subroutine new_abs: not called CC=1 SCAR=6.9
Pod documented
105 0 my $class = shift;
106  
107 0 my $self = {
108 obj => URI->new_abs($class->_deflate_uris(@_)),
109 factory_class => $class
110 };
111  
112 0 bless $self, $class->_make_uri_class(blessed $self->{obj}, 1);
113 }
114  
115 =head2 URI::SmartURI->newlocal($filename, [$os])
116  
117 Proxy for L<URI::URL>->newlocal
118  
119 =cut
120  
121 0 ▶sub newlocal {
Subroutine newlocal: not called CC=1 SCAR=6.9
Pod documented
122 0 my $class = shift;
123  
124 0 my $self = {
125 obj => URI::URL->newlocal($class->_deflate_uris(@_)),
126 factory_class => $class
127 };
128  
129 0 bless $self, $class->_make_uri_class(blessed $self->{obj}, 1);
130 }
131  
132 =head1 METHODS
133  
134 =head2 $uri->hostless
135  
136 Returns the URI with the scheme and host parts stripped.
137  
138 =cut
139  
140 5 ▶sub hostless {
Subroutine hostless: called CC=1 SCAR=0.0
Pod documented
141 5 my $uri = $_[0]->clone;
142  
143 5 $uri->scheme('');
144 5 $uri->host('');
145 5 $uri->port('');
146  
147 5 $uri->factory_class->new(($uri =~ m!^[/:]*(/.*)!), $_[0]->_opts);
148 }
149  
150 =head2 $uri->reference
151  
152 Accessor for the reference URI (for relative/absolute below.)
153  
154 =head2 $uri->relative
155  
156 Returns the URI relative to the reference URI.
157  
158 =cut
159  
160 3 ▶sub relative { $_[0]->rel($_[0]->reference) }
Subroutine relative: called CC=1 SCAR=0.0
Pod documented
161  
162 =head2 $uri->absolute
163  
164 Returns the absolute URI using the reference URI as base.
165  
166 =cut
167  
168 3 ▶sub absolute { $_[0]->abs($_[0]->reference) }
Subroutine absolute: called CC=1 SCAR=0.0
Pod documented
169  
170 =head2 ""
171  
172 stringification works, just like with L<URI>s
173  
174 =head2 ==
175  
176 and == does as well
177  
178 =cut
179  
180 use overload
181 12 ▶ '""' => sub { "".$_[0]->obj },
Subroutine BEGIN: called CC=1 SCAR=0.1
Subroutine __ANON__: called CC=1 SCAR=0.0
182 '==' =>
183 0 ▶ sub { overload::StrVal($_[0]->obj) eq overload::StrVal($_[1]->obj) },
Subroutine __ANON__: not called CC=1 SCAR=6.9
184 2 fallback => 1;
185  
186 =head2 $uri->eq($other_uri)
187  
188 Explicit equality check to another URI, can be used as
189 URI::SmartURI::eq($uri1, $uri2) as well.
190  
191 =cut
192  
193 3 ▶sub eq {
Subroutine eq: called CC=3 SCAR=11.1
Pod documented
194 3 my ($self, $other) = @_;
195  
196 # Support URI::eq($first, $second) syntax. Not inheritance-safe :(
197 3 ▶ $self = blessed $self ? $self : __PACKAGE__->new($self);
Branch: 1 branch
BranchTrueFalseTotal
builtin::blessed($self) ? : 3 0 3
198  
199 3 ▶ return $self->obj->eq(ref $other eq blessed $self ? $other->obj : $other);
Branch: 1 branch
BranchTrueFalseTotal
ref $other eq builtin::blessed($self) ? : 1 2 3
200 }
201  
202 =head2 $uri->obj
203  
204 Accessor for the L<URI> object methods are delegated to.
205  
206 =head2 $uri->factory_class
207  
208 The class whose constructor was called to create the $uri object, usually
209 L<URI::SmartURI> or your own subclass. This is used to call class (rather
210 than object) methods.
211  
212 =cut
213  
214 # The gory details
215  
216 30 ▶sub AUTOLOAD {
Subroutine AUTOLOAD: called CC=6 SCAR=18.1
217 2 ▶ use vars qw/$CAN $AUTOLOAD/;
Subroutine BEGIN: called CC=1 SCAR=0.0
218 2 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
219 30 my $self = $_[0];
220 # stolen from URI sources
221 30 my $method = substr($AUTOLOAD, rindex($AUTOLOAD, '::')+2);
222  
223 30 ▶ return if ! blessed $self || ! blessed $self->obj
Branch: 1 branch
BranchTrueFalseTotal
if not builtin::blessed($self) && builtin::blessed($self->obj) or $method eq "DESTROY" or not $self->obj->can($method) 20 10 30
Condition44%4/9
not builtin::blessed($self) && builtin::blessed($self->obj) or $method eq "DESTROY" or not $self->obj->can($method)
l!l&&r!l&&!r
02010
not builtin::blessed($self) && builtin::blessed($self->obj) or $method eq "DESTROY"
l!l&&r!l&&!r
0030
builtin::blessed($self) && builtin::blessed($self->obj)
!ll&&!rl&&r
0030
MC/DC25%1/4
not builtin::blessed($self) && builtin::blessed($self->obj) or $method eq "DESTROY" or not $self->obj->can($method)
builtin::blessed($self) builtin::blessed($self->obj) $method eq "DESTROY" not $self->obj->can($method)
Truth table40%2/5
not(A && B) or C or not(D)
A= builtin::blessed($self)B= builtin::blessed($self->obj)C= $method eq "DESTROY"D= not $self->obj->can($method)
ABCDresult
0XXX1
10XX1
111X1
11011
11000
224 || $method eq 'DESTROY'
225 || ! $self->obj->can($method);
226  
227 10 my $class = $self->factory_class;
228  
229 10 my $sub = blessed($self)."::$method";
230  
231 10 ▶ *{$sub} = sub {
Subroutine __ANON__: called CC=4 SCAR=13.9
232 58 my $self = shift;
233 58 my @res;
234 58 ▶ if (wantarray) {
Branch: 1 branch
BranchTrueFalseTotal
if (wantarray) { } 1 57 58
235 1 @res = $self->obj->$method($class->_deflate_uris(@_));
236 } else {
237 57 $res[0] = $self->obj->$method($class->_deflate_uris(@_));
238 }
239 58 ▶ @res = $class->_inflate_uris(
Branch: 1 branch
BranchTrueFalseTotal
$method ne 'scheme' ? : 24 34 58
240 \@res,
241 $method ne 'scheme' ? $self->_opts : {}
242 );
243  
244 58 ▶ return wantarray ? @res : $res[0];
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 1 57 58
245 10 };
246  
247 10 Class::C3::reinitialize;
248
249 10 ▶ $CAN ? \&$sub : goto &$sub;
Branch: 1 branch
BranchTrueFalseTotal
$URI::SmartURI::CAN ? : 0 10 10
250 }
251  
252 21 ▶sub can { # of PORK BRAINS in MILK GRAVY, yum!!!
Subroutine can: called CC=3 SCAR=11.0
Pod undocumented
253 2 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
254 2 ▶ use vars qw/$CAN $AUTOLOAD/;
Subroutine BEGIN: called CC=1 SCAR=0.0
255 21 my ($self, $method) = @_;
256  
257 21 ▶ if ($method eq 'can') {
Branch: 1 branch
BranchTrueFalseTotal
if ($method eq "can") 1 20 21
258 1 return \&can;
259 }
260  
261 20 my $existing = eval { $self->next::method($method) };
262 20 undef $@;
263 20 ▶ return $existing if $existing;
Branch: 1 branch
BranchTrueFalseTotal
if $existing 0 20 20
264  
265 20 local $AUTOLOAD = ref($self)."::$method";
266 20 local $CAN = 1;
267  
268 20 $self->$method
269 }
270  
271 # Preload some URI classes, the ones that come in files anyway,
272 # but only if asked to.
273 2 ▶sub import {
Subroutine import: called CC=5 SCAR=16.1
274 2 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
275 2 my $class = shift;
276  
277 2 ▶ return unless $_[0] && $_[0] eq '-import_uri_mods';
Branch: 1 branch
BranchTrueFalseTotal
unless $_[0] and $_[0] eq "-import_uri_mods" 1 1 2
Condition66%2/3
$_[0] and $_[0] eq "-import_uri_mods"
!ll&&!rl&&r
101
MC/DC50%1/2
$_[0] and $_[0] eq "-import_uri_mods"
$_[0] $_[0] eq "-import_uri_mods"
Truth table66%2/3
A and B
A= $_[0]B= $_[0] eq "-import_uri_mods"
ABresult
0X0
100
111
278  
279 # File::Find::Rule is not taint safe, and Module::Starter suggests running
280 # tests in taint mode. Thanks for helping me with this one Somni!!!
281 # UPDATE: I turned off taint in tests because it breaks local::lib
282 {
283 2 ▶ no warnings 'redefine';
Subroutine BEGIN: called CC=1 SCAR=0.0
284 1 my $getcwd = \&File::Find::Rule::getcwd;
285 0 ▶ *File::Find::Rule::getcwd = sub { $getcwd->() =~ m!^(.*)\z! };
Subroutine __ANON__: not called CC=1 SCAR=1.2
286 # What are portably valid characters in a directory name anyway?
287 }
288  
289 my @uri_pms = grep !/SmartURI\.pm\z/,
290 File::Find::Rule->extras({untaint => 1})->file->name('*.pm')
291 ->in( File::Find::Rule->extras({untaint => 1})->directory
292 ->maxdepth(1)->name('URI')->in(
293 1 ▶ grep { !ref($_) && -d $_ } @INC
Condition33%1/3
!ref($_) && -d $_
!ll&&!rl&&r
009
MC/DC0%0/2
!ref($_) && -d $_
!ref($_) -d $_
Truth table33%1/3
not(A) && B
A= !ref($_)B= -d $_
ABresult
0X0
100
111
294 )
295 );
296  
297 1 my @new_uri_pms;
298  
299 1 for (@uri_pms) {
300 67 my ($vol, $dir, $file) = splitpath $_;
301  
302 67 my @dir = grep $_ ne '', splitdir $dir;
303 67 ▶ my @rel_dir = @dir[(firstidx { $_ eq 'URI' } @dir) .. $#dir];
Subroutine __ANON__: called CC=1 SCAR=0.0
304 67 my $mod = join '::' => @rel_dir, ($file =~ /^(.*)\.pm\z/);
305  
306 67 my $new_class = $class->_make_uri_class($mod, 0);
307  
308 67 push @new_uri_pms, (join '/' => (split /::/, $new_class)) . '.pm';
309 }
310  
311 # HLAGHALAGHLAGHLAGHLAGH
312 3 ▶ push @INC, sub {
Subroutine __ANON__: called CC=2 SCAR=6.9
313 3 ▶ if (first { $_ eq $_[1] } @new_uri_pms) {
Subroutine __ANON__: called CC=1 SCAR=0.0
Branch: 1 branch
BranchTrueFalseTotal
if (&first(sub { $_ eq $_[1]; } , @new_uri_pms)) 1 2 3
314 1 open my $fh, '<', \"1;\n";
315 1 return $fh;
316 }
317 1 };
318  
319 1 Class::C3::reinitialize;
320 }
321  
322 =head1 INTERNAL METHODS
323  
324 These are used internally by SmartURI, and are not interesting for general use,
325 but may be useful for writing subclasses.
326  
327 =head2 $uri->_opts
328  
329 Returns a hashref of options for the $uri (reference and scheme.)
330  
331 =cut
332  
333 29 ▶sub _opts { +{
Subroutine _opts: called CC=3 SCAR=11.0
334 29 ▶ reference => $_[0]->reference || undef,
Condition100%4/4
$_[0]->reference || undef
l!l
281
$_[0]->scheme || undef
l!l
1613
MC/DC100%1/1
$_[0]->reference || undef
$_[0]->reference
MC/DC100%1/1
$_[0]->scheme || undef
$_[0]->scheme
Truth table100%2/2
A
A= $_[0]->reference
Aresult
11
00
Truth table100%2/2
A
A= $_[0]->scheme
Aresult
11
00
335 scheme => $_[0]->scheme || undef
336 } }
337  
338  
339 =head2 $class->_resolve_uri_class($uri_class)
340  
341 Converts, eg., "URI::http" to "URI::SmartURI::http".
342  
343 =cut
344  
345 86 ▶sub _resolve_uri_class {
Subroutine _resolve_uri_class: called CC=1 SCAR=0.0
346 86 my ($class, $uri_class) = @_;
347  
348 86 (my $new_class = $uri_class) =~ s/^URI::/${class}::/;
349  
350 86 return $new_class;
351 }
352  
353 =head2 $class->_make_uri_class($uri_class)
354  
355 Creates a new proxy class class for a L<URI> class, with all exports and
356 constructor intact, and returns its name, which is made using
357 _resolve_uri_class (above).
358  
359 =cut
360  
361 86 ▶sub _make_uri_class {
Subroutine _make_uri_class: called CC=3 SCAR=11.6
362 86 my ($class, $uri_class, $re_init_c3) = @_;
363  
364 86 my $new_uri_class = $class->_resolve_uri_class($uri_class);
365  
366 2 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
367 2 ▶ no warnings 'redefine';
Subroutine BEGIN: called CC=1 SCAR=0.0
368  
369 86 ▶ unless (%{$new_uri_class.'::'}) {
Branch: 1 branch
BranchTrueFalseTotal
unless (%{$new_uri_class . '::';}) 68 18 86
370 68 Class::C3::Componentised->inject_base(
371 $new_uri_class, $class, 'Exporter'
372 );
373  
374 68 ▶ *{$new_uri_class.'::new'} = sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
375 1 eval "require $uri_class";
376 1 bless {
377 obj => $uri_class->new($class->_deflate_uris(@_[1..$#_])),
378 factory_class => $class
379 }, $new_uri_class;
380 68 };
381  
382 68 ▶ *{$new_uri_class.'::import'} = sub {
Subroutine __ANON__: called CC=4 SCAR=17.1
383 1 shift; # $class
384  
385 1 eval "require $uri_class;";
386 # URI doesn't use tags, thank god...
387 1 my @vars = grep /^\W/, @_;
388 1 my @subs = (@{$uri_class.'::EXPORT'}, grep /^\w/, @_);
389  
390 1 ▶ if (@vars) {
Branch: 1 branch
BranchTrueFalseTotal
if (@vars) 0 1 1
391 0 my $import = $uri_class->can('import');
392 0 @_ = ($uri_class, @vars);
393 0 goto &$import;
394 }
395  
396 1 for (@subs) {
397 1 my $sub = $uri_class."::$_";
398 1 my $proto = prototype $sub;
399 1 ▶ $proto = $proto ? "($proto)" : '';
Branch: 1 branch
BranchTrueFalseTotal
$proto ? : 1 0 1
400 0 ▶ eval qq{
Subroutine url: not called CC=3 SCAR=22.8
Pod undocumented
Branch: 2 branches
BranchTrueFalseTotal
if (wantarray) { } 0 0 0
wantarray ? : 0 0 0
401 sub ${new_uri_class}::$_ $proto {
402 my \@res;
403 if (wantarray) {
404 \@res = &${sub}($class->_deflate_uris(\@_));
405 } else {
406 \$res[0] = &${sub}($class->_deflate_uris(\@_));
407 }
408  
409 \@res = $class->_inflate_uris(\\\@res);
410  
411 return wantarray ? \@res : \$res[0];
412 }
413 };
414 }
415  
416 1 @{$new_uri_class."::EXPORT_OK"} = @subs;
417  
418 1 local $^W; # get rid of more redefined warnings
419 1 $new_uri_class->export_to_level(1, $new_uri_class, @subs);
420 68 };
421  
422 68 ▶ Class::C3::reinitialize if $re_init_c3;
Branch: 1 branch
BranchTrueFalseTotal
if $re_init_c3 1 67 68
423 }
424  
425 86 return $new_uri_class;
426 }
427  
428 =head2 $class->_inflate_uris(\@rray, $opts)
429  
430 Inflate any L<URI> objects in @rray into URI::SmartURI objects, all other
431 members pass through unharmed. $opts is a hashref of options to include in the
432 objects created.
433  
434 =cut
435  
436 58 ▶sub _inflate_uris {
Subroutine _inflate_uris: called CC=6 SCAR=18.3
437 58 my $class = shift;
438 58 my ($args, $opts) = @_;
439  
440 58 ▶ my @res = map { blessed($_) && blessed($_) =~ /^URI::/ ?
Branch: 2 branches
BranchTrueFalseTotal
builtin::blessed($_) && builtin::blessed($_) =~ /^URI::/ ? : 11 46 57
defined $opts ? : 11 0 11
Condition66%2/3
builtin::blessed($_) and builtin::blessed($_) =~ /^URI::/
!ll&&!rl&&r
46011
MC/DC50%1/2
builtin::blessed($_) and builtin::blessed($_) =~ /^URI::/
builtin::blessed($_) builtin::blessed($_) =~ /^URI::/
Truth table66%2/3
A and B
A= builtin::blessed($_)B= builtin::blessed($_) =~ /^URI::/
ABresult
0X0
100
111
441 bless {
442 obj => $_,
443 factory_class => $class,
444 (defined $opts ? %$opts : ())
445 },
446 $class->_make_uri_class(blessed $_, 1)
447 :
448 $_
449 } @$args;
450 58 ▶ @res ? @res == 1 ? $res[0] : @res : ();
Branch: 2 branches
BranchTrueFalseTotal
@res ? : 57 1 58
@res == 1 ? : 57 0 57
451 }
452  
453 =head2 $class->_deflate_uris(@rray)
454  
455 Deflate any L<URI::SmartURI> objects in @rray into the L<URI> objects
456 they are proxies for, all other members pass through unharmed.
457  
458 =cut
459  
460 67 ▶sub _deflate_uris {
Subroutine _deflate_uris: called CC=5 SCAR=16.7
461 67 my $class = shift;
462 67 ▶ my @res = map { blessed $_ && $_->isa($class) ? $_->{obj} : $_ } @_;
Branch: 1 branch
BranchTrueFalseTotal
builtin::blessed($_) && $_->isa($class) ? : 0 39 39
Condition33%1/3
builtin::blessed($_) and $_->isa($class)
!ll&&!rl&&r
3900
MC/DC0%0/2
builtin::blessed($_) and $_->isa($class)
builtin::blessed($_) $_->isa($class)
Truth table33%1/3
A and B
A= builtin::blessed($_)B= $_->isa($class)
ABresult
0X0
100
111
463 67 ▶ @res ? @res == 1 ? $res[0] : @res : ();
Branch: 2 branches
BranchTrueFalseTotal
@res ? : 31 36 67
@res == 1 ? : 23 8 31
464 }
465  
466 =head1 MAGICAL IMPORT
467  
468 On import with the C<-import_uri_mods> flag it loads all the URI .pms into your
469 class namespace.
470  
471 This works:
472  
473 use URI::SmartURI '-import_uri_mods';
474 use URI::SmartURI::WithBase;
475 use URI::SmartURI::URL;
476  
477 my $url = URI::SmartURI::URL->new(...); # URI::URL proxy
478  
479 Even this works:
480  
481 use URI::SmartURI '-import_uri_mods';
482 use URI::SmartURI::Escape qw(%escapes);
483  
484 It even works with a subclass of L<URI::SmartURI>.
485  
486 I only wrote this functionality so that I could run the URI test suite without
487 much modification, it has no real practical value.
488  
489 =head1 BUGS
490  
491 Please report any bugs or feature requests to
492 C<bug-uri-smarturi at rt.cpan.org>, or through the web
493 interface at
494 L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=URI-SmartURI>. I
495 will be notified, and then you'll automatically be notified of progress on your
496 bug as I make changes.
497  
498 =head1 SUPPORT
499  
500 You can find documentation for this module with the perldoc command.
501  
502 perldoc URI::SmartURI
503  
504 You can also look for information at:
505  
506 =over 4
507  
508 =item * RT: CPAN's request tracker
509  
510 L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=URI-SmartURI>
511  
512 =item * AnnoCPAN: Annotated CPAN documentation
513  
514 L<http://annocpan.org/dist/URI-SmartURI>
515  
516 =item * CPAN Ratings
517  
518 L<http://cpanratings.perl.org/d/URI-SmartURI>
519  
520 =item * Search CPAN
521  
522 L<http://search.cpan.org/dist/URI-SmartURI>
523  
524 =back
525  
526 =head1 SEE ALSO
527  
528 L<Catalyst::Plugin::SmartURI>, L<URI>, L<URI::WithBase>
529  
530 =head1 ACKNOWLEDGEMENTS
531  
532 Thanks to folks on freenode #perl for helping me out when I was getting stuck,
533 Somni, revdiablo, PerlJam and others whose nicks I forget.
534  
535 =head1 AUTHOR
536  
537 Rafael Kitover, C<< <rkitover at cpan.org> >>
538  
539 =head1 COPYRIGHT & LICENSE
540  
541 Copyright (c) 2008 Rafael Kitover
542  
543 This program is free software; you can redistribute it and/or modify it under
544 the same terms as Perl itself.
545  
546 =cut
547  
548 2 __PACKAGE__->meta->make_immutable(inline_constructor => 0);
549  
550 2 'LONG LIVE THE ALMIGHTY BUNGHOLE';
551  
552 # vim: expandtab shiftwidth=4 tw=80:
↑ Summary