Skip to content

Commit

Permalink
removed a few deprecated attributes and methods
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jan 12, 2014
1 parent 86f8416 commit 938d916
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 76 deletions.
8 changes: 8 additions & 0 deletions Changes
@@ -1,5 +1,13 @@

4.68 2014-01-12
- Removed deprecated http_proxy attribute from Mojo::UserAgent.
- Removed deprecated https_proxy attribute from Mojo::UserAgent.
- Removed deprecated name attribute from Mojo::UserAgent.
- Removed deprecated no_proxy attribute from Mojo::UserAgent.
- Removed deprecated app method from Mojo::UserAgent.
- Removed deprecated app_url method from Mojo::UserAgent.
- Removed deprecated detect_proxy method from Mojo::UserAgent.
- Removed deprecated need_proxy method from Mojo::UserAgent.
- Improved list of available commands to be alphabetical. (jberger)

4.67 2014-01-11
Expand Down
73 changes: 1 addition & 72 deletions lib/Mojo/UserAgent.pm
Expand Up @@ -6,7 +6,7 @@ use Mojo::Base 'Mojo::EventEmitter';
use Carp 'croak';
use Mojo::IOLoop;
use Mojo::URL;
use Mojo::Util qw(deprecated monkey_patch);
use Mojo::Util 'monkey_patch';
use Mojo::UserAgent::CookieJar;
use Mojo::UserAgent::Proxy;
use Mojo::UserAgent::Server;
Expand Down Expand Up @@ -41,72 +41,9 @@ for my $name (qw(DELETE GET HEAD OPTIONS PATCH POST PUT)) {

sub DESTROY { shift->_cleanup }

# DEPRECATED in Top Hat!
sub new {
my $self = shift->SUPER::new(@_);
for my $key (keys %$self) { $self->$key(delete $self->{$key}) }
return $self;
}

# DEPRECATED in Top Hat!
sub app {
deprecated 'Mojo::UserAgent::app is DEPRECATED in favor of'
. ' Mojo::UserAgent::Server::app';
shift->_delegate('server', 'app', @_);
}

# DEPRECATED in Top Hat!
sub app_url {
deprecated 'Mojo::UserAgent::app_url is DEPRECATED in favor of'
. ' Mojo::UserAgent::Server::url';
shift->_delegate('server', 'url', @_);
}

sub build_tx { shift->transactor->tx(@_) }
sub build_websocket_tx { shift->transactor->websocket(@_) }

# DEPRECATED in Top Hat!
sub detect_proxy {
deprecated 'Mojo::UserAgent::detect_proxy is DEPRECATED in favor of'
. ' Mojo::UserAgent::Proxy::detect';
shift->tap(sub { $_->proxy->detect });
}

# DEPRECATED in Top Hat!
sub http_proxy {
deprecated 'Mojo::UserAgent::http_proxy is DEPRECATED in favor of'
. ' Mojo::UserAgent::Proxy::http';
shift->_delegate('proxy', 'http', @_);
}

# DEPRECATED in Top Hat!
sub https_proxy {
deprecated 'Mojo::UserAgent::https_proxy is DEPRECATED in favor of'
. ' Mojo::UserAgent::Proxy::https';
shift->_delegate('proxy', 'https', @_);
}

# DEPRECATED in Top Hat!
sub name {
deprecated 'Mojo::UserAgent::name is DEPRECATED in favor of'
. ' Mojo::UserAgent::Transactor::name';
shift->_delegate('transactor', 'name', @_);
}

# DEPRECATED in Top Hat!
sub no_proxy {
deprecated 'Mojo::UserAgent::no_proxy is DEPRECATED in favor of'
. ' Mojo::UserAgent::Proxy::not';
shift->_delegate('proxy', 'not', @_);
}

# DEPRECATED in Top Hat!
sub need_proxy {
deprecated 'Mojo::UserAgent::need_proxy is DEPRECATED in favor of'
. ' Mojo::UserAgent::Proxy::is_needed';
shift->proxy->is_needed(@_);
}

sub start {
my ($self, $tx, $cb) = @_;

Expand Down Expand Up @@ -275,14 +212,6 @@ sub _connection {
return $id;
}

# DEPRECATED in Top Hat!
sub _delegate {
my ($self, $attr, $name) = (shift, shift, shift);
return $self->$attr->$name unless @_;
$self->$attr->$name(@_);
return $self;
}

sub _dequeue {
my ($self, $name, $test) = @_;

Expand Down
5 changes: 1 addition & 4 deletions t/pod_coverage.t
Expand Up @@ -8,10 +8,7 @@ plan skip_all => 'Test::Pod::Coverage 1.04 required for this test!'
unless eval 'use Test::Pod::Coverage 1.04; 1';

# DEPRECATED in Top Hat!
my @tophat = (
qw(app app_url detect_proxy http_proxy https_proxy name need_proxy new),
qw(no_proxy secret to_rel)
);
my @tophat = qw(secret to_rel);

# False positive constants
all_pod_coverage_ok({also_private => [qw(IPV6 TLS), @tophat]});

0 comments on commit 938d916

Please sign in to comment.