X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMooseX%2FTypes%2FWrapper.pm;h=1c53ef9d5e6e1f41d60608735ffb615004f1d406;hb=4eb26e95f22b3969b85ef62b2aca03c024b9b4e7;hp=4d08c22162a59872680c47635dae8f7fad4b532c;hpb=3da38ef893627fa8efeecd85c69ffd1ff4ddb4e6;p=gitmo%2FMooseX-Types.git diff --git a/lib/MooseX/Types/Wrapper.pm b/lib/MooseX/Types/Wrapper.pm index 4d08c22..1c53ef9 100644 --- a/lib/MooseX/Types/Wrapper.pm +++ b/lib/MooseX/Types/Wrapper.pm @@ -1,17 +1,13 @@ -=head1 NAME - -MooseX::Types::Wrapper - Wrap exports from a library +package MooseX::Types::Wrapper; -=cut +#ABSTRACT: Wrap exports from a library -package MooseX::Types::Wrapper; -our $VERSION = "0.24"; use Moose; use Carp::Clan qw( ^MooseX::Types ); -use Class::MOP; +use Module::Runtime 'use_module'; -use namespace::clean -except => [qw( meta )]; +use namespace::autoclean; extends 'MooseX::Types'; @@ -34,11 +30,11 @@ sub import { croak qq($class expects an array reference as import spec) unless ref $libraries{ $l } eq 'ARRAY'; - my $library_class + my $library_class = ($l eq 'Moose' ? 'MooseX::Types::Moose' : $l ); - Class::MOP::load_class($library_class); + use_module($library_class); - $library_class->import({ + $library_class->import({ -into => scalar(caller), -wrapper => $class, }, @{ $libraries{ $l } }); @@ -52,10 +48,6 @@ sub import { L -=head1 AUTHOR - -See L. - =head1 LICENSE This program is free software; you can redistribute it and/or modify