From: Karen Etheridge Date: Sat, 14 Sep 2013 19:32:12 +0000 (-0700) Subject: Class::MOP::load_class was deprecated in Moose-2.1100 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7da369caa65930c3f7edf9c6878468ab1454d33a;p=gitmo%2FMooseX-Runnable.git Class::MOP::load_class was deprecated in Moose-2.1100 --- diff --git a/Changes b/Changes index b9d002b..d453902 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,6 @@ - converted uses of Path::Class to Path::Tiny (Karen Etheridge) + - removed use of deprecated Class::MOP::load_class 0.03 Sat Jun 26 23:19:41 CDT 2010 - modified verification of RunnableClass values to use diff --git a/lib/MooseX/Runnable/Invocation.pm b/lib/MooseX/Runnable/Invocation.pm index b21617c..d340743 100644 --- a/lib/MooseX/Runnable/Invocation.pm +++ b/lib/MooseX/Runnable/Invocation.pm @@ -4,10 +4,9 @@ use MooseX::Types -declare => ['RunnableClass']; use MooseX::Types::Moose qw(Str HashRef ArrayRef); use List::MoreUtils qw(uniq); use Params::Util qw(_CLASS); +use Module::Runtime 'use_module'; use namespace::autoclean; -require Class::MOP; - # we can't load the class until plugins are loaded, # so we have to handle this outside of coerce @@ -45,7 +44,7 @@ sub BUILD { $plugin = "$plugin_ns$plugin" unless $plugin =~ /^[+]/; $plugin =~ s/^[+]//g; - Class::MOP::load_class( $plugin ); + use_module( $plugin ); my $does_cmdline = $plugin->meta-> does_role('MooseX::Runnable::Invocation::Plugin::Role::CmdlineArgs'); @@ -81,7 +80,7 @@ sub load_class { my $self = shift; my $class = $self->class; - Class::MOP::load_class( $class ); + use_module( $class ); confess 'We can only work with Moose classes with "meta" methods' if !$class->can('meta'); @@ -123,7 +122,7 @@ sub _convert_role_to_scheme { $name = "MooseX::Runnable::Invocation::Scheme::$name"; return eval { - Class::MOP::load_class($name); + use_module($name); warn "$name was loaded OK, but it's not a role!" and return unless $name->meta->isa('Moose::Meta::Role'); return $name->meta;