diff options
author | Chisel <chisel@chizography.net> | 2014-01-08 15:58:51 +0000 |
---|---|---|
committer | Chisel <chisel@chizography.net> | 2014-01-08 16:04:06 +0000 |
commit | 01825f92b69002d411c46d23bceb1b6c2037f410 (patch) | |
tree | e013ce0c1a3e209a7e623f6c3fdd329e6a03a496 | |
parent | Merge pull request #26 from oalders/master (diff) | |
download | net-http-spore-01825f92b69002d411c46d23bceb1b6c2037f410.tar.gz |
Use Class::Load::load_class instead of Class::MOP::load_class
This should resolve franckcuny/net-http-spore/#32 No new deps need to be specified as the dist uses [AutoPrereqs]
-rw-r--r-- | lib/Net/HTTP/Spore/Role/Middleware.pm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Net/HTTP/Spore/Role/Middleware.pm b/lib/Net/HTTP/Spore/Role/Middleware.pm index 88d64d4..7fe7310 100644 --- a/lib/Net/HTTP/Spore/Role/Middleware.pm +++ b/lib/Net/HTTP/Spore/Role/Middleware.pm @@ -1,6 +1,7 @@ package Net::HTTP::Spore::Role::Middleware; use Moose::Role; +use Class::Load; use Scalar::Util qw/blessed/; has middlewares => ( @@ -16,7 +17,7 @@ has middlewares => ( sub _load_middleware { my ( $self, $mw, $cond, @args ) = @_; - Class::MOP::load_class($mw) unless blessed($mw); + Class::Load::load_class($mw) unless blessed($mw); my $code = $mw->wrap( $cond, @args ); $self->_trace_msg('== enabling middleware %s', $mw); @@ -51,7 +52,7 @@ sub enable_if { confess "condition must be a code ref" if (!$cond || ref $cond ne 'CODE'); if(ref($mw) eq 'CODE'){ # anonymous middleware - Class::MOP::load_class('Net::HTTP::Spore::Middleware'); + Class::Load::load_class('Net::HTTP::Spore::Middleware'); my $anon = Class::MOP::Class->create_anon_class( superclasses => ['Net::HTTP::Spore::Middleware'], methods => { |