use strict;
use warnings;
+use Data::OptList;
use Sub::Exporter;
use Scalar::Util 'blessed';
use Class::MOP 0.60;
-our $VERSION = '0.76';
+our $VERSION = '0.85';
$VERSION = eval $VERSION;
our $AUTHORITY = 'cpan:STEVAN';
my $roles = Data::OptList::mkopt( [@_] );
foreach my $role (@$roles) {
- my $meta = Class::MOP::load_class( $role->[0] );
+ Class::MOP::load_class( $role->[0] );
+ my $meta = Class::MOP::class_of( $role->[0] );
- unless ($meta->isa('Moose::Meta::Role') ) {
+ unless ($meta && $meta->isa('Moose::Meta::Role') ) {
require Moose;
Moose->throw_error( "You can only consume roles, "
. $role->[0]
return $list;
}
+sub _caller_info {
+ my $level = @_ ? ($_[0] + 1) : 2;
+ my %info;
+ @info{qw(package file line)} = caller($level);
+ return \%info;
+}
+
1;
__END__