summary refs log tree commit diff
diff options
context:
space:
mode:
authorAsh Berlin <ash_github@firemirror.com>2014-01-25 02:33:06 -0800
committerAsh Berlin <ash_github@firemirror.com>2014-01-25 02:33:06 -0800
commit53a09ddc5f87a37f71c9574ddec0dcbd976f2eaa (patch)
treee013ce0c1a3e209a7e623f6c3fdd329e6a03a496
parentMerge pull request #26 from oalders/master (diff)
parentUse Class::Load::load_class instead of Class::MOP::load_class (diff)
downloadnet-http-spore-53a09ddc5f87a37f71c9574ddec0dcbd976f2eaa.tar.gz
Merge pull request #33 from chiselwright/class_load
Use Class::Load::load_class instead of Class::MOP::load_class
-rw-r--r--lib/Net/HTTP/Spore/Role/Middleware.pm5
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 => {