Permalink
Browse files

removed uri_with. Implement this in your framework if you need it

  • Loading branch information...
1 parent 98ea7df commit 2f6b5d56d98d17092261737d483cbfd51f2f901c @miyagawa miyagawa committed Oct 22, 2009
Showing with 1 addition and 64 deletions.
  1. +0 −1 MANIFEST
  2. +0 −29 lib/Plack/Request.pm
  3. +0 −18 t/Plack-Request/can.t
  4. +1 −16 t/Plack-Request/uri.t
View
@@ -30,7 +30,6 @@ README
t/00_compile.t
t/Plack-Request/as_http_request.t
t/Plack-Request/body.t
-t/Plack-Request/can.t
t/Plack-Request/content.t
t/Plack-Request/cookie.t
t/Plack-Request/double_port.t
View
@@ -367,28 +367,6 @@ sub _build_uri {
sub path { shift->uri->path(@_) }
-sub uri_with {
- my($self, $args) = @_;
-
- Carp::carp( 'No arguments passed to uri_with()' ) unless $args;
-
- for my $value (values %{ $args }) {
- next unless defined $value;
- for ( ref $value eq 'ARRAY' ? @{ $value } : $value ) {
- $_ = "$_";
- utf8::encode( $_ );
- }
- };
-
- my $uri = $self->uri->clone;
-
- $uri->query_form( {
- %{ $uri->query_form_hash },
- %{ $args },
- } );
- return $uri;
-}
-
sub new_response {
my $self = shift;
require Plack::Response;
@@ -590,13 +568,6 @@ A convenient method to access $req->uploads.
print $upload->filename;
}
-
-=item uri_with
-
-Returns a rewritten URI object for the current request. Key/value pairs
-passed in will override existing parameters. Unmodified pairs will be
-preserved.
-
=item as_http_request
convert Plack::Request to HTTP::Request.
View
@@ -1,18 +0,0 @@
-use strict;
-use Test::More (tests => 2);
-
-BEGIN
-{
- use_ok "Plack::Request";
-}
-
-can_ok( "Plack::Request",
- qw(address cookies method protocol query_parameters uri user raw_body headers),
- qw(body_params input params query_params path_info body),
- qw(body_parameters cookies hostname param parameters path upload uploads),
- qw(uri_with as_http_request),
- qw(raw_uri base),
-
- # delegated methods
- qw(content_encoding content_length content_type header referer user_agent)
-);
View
@@ -5,7 +5,7 @@ use IO::Scalar;
use t::Utils;
-plan tests => 4*blocks;
+plan tests => 2*blocks;
filters {
args => ['yaml'],
@@ -31,18 +31,11 @@ run {
is $req->uri, $block->expected_uri;
is_deeply $req->query_parameters, $block->expected_params;
- is $req->uri_with( $block->args || {} ), $block->expected;
-
- tie *STDERR, 'IO::Scalar', \my $out;
- $req->uri_with;
- untie *STDERR;
- like $out, qr/No arguments passed to uri_with()/;
};
__END__
===
---- args
--- add_env
HTTP_HOST: example.com
SCRIPT_NAME: /
@@ -51,7 +44,6 @@ __END__
--- expected_params: {}
===
---- args
--- add_env
HTTP_HOST: example.com
SCRIPT_NAME: /test.c
@@ -60,7 +52,6 @@ __END__
--- expected_params: {}
===
---- args
--- add_env
HTTP_HOST: example.com
SCRIPT_NAME: /test.c
@@ -70,7 +61,6 @@ __END__
--- expected_params: {}
===
---- args
--- add_env
HTTP_HOST: example.com
SCRIPT_NAME: /test
@@ -81,7 +71,6 @@ __END__
===
---- args
--- add_env
HTTP_HOST: example.com
SCRIPT_NAME: /exec/
@@ -90,7 +79,6 @@ __END__
--- expected_params: {}
===
---- args
--- add_env
HTTP_HOST: example.com
SCRIPT_NAME: /////exec/
@@ -99,22 +87,19 @@ __END__
--- expected_params: {}
===
---- args
--- add_env
SERVER_NAME: example.com
--- expected_uri: http://example.com/
--- expected: http://example.com/
--- expected_params: {}
===
---- args
--- add_env
--- expected_uri: http:///
--- expected: http:///
--- expected_params: {}
===
---- args
--- add_env
HTTP_HOST: example.com
SCRIPT_NAME: /

0 comments on commit 2f6b5d5

Please sign in to comment.