move repository to http://github.com/moose/MooseX-Types
[gitmo/MooseX-Types.git] / lib / MooseX / Types / Combine.pm
index 0fdaa69..cc85815 100644 (file)
@@ -1,15 +1,10 @@
-=head1 NAME
-
-MooseX::Types::Combine - Combine type libraries for exporting
-
-=cut
-
 package MooseX::Types::Combine;
-our $VERSION = "0.26";
+
+# ABSTRACT: Combine type libraries for exporting
 
 use strict;
 use warnings;
-use Class::MOP ();
+use Module::Runtime 'use_module';
 
 =head1 SYNOPSIS
 
@@ -25,9 +20,9 @@ use Class::MOP ();
 
 =head1 DESCRIPTION
 
-Allows you to export types from multiple type libraries. 
+Allows you to export types from multiple type libraries.
 
-Libraries on the right side of the type libs passed to L</provide_types_from>
+Libraries on the right end of the list passed to L</provide_types_from>
 take precedence over those on the left in case of conflicts.
 
 =cut
@@ -38,6 +33,12 @@ sub import {
 
     my %types = $class->_provided_types;
 
+    if ( grep { $_ eq ':all' } @types ) {
+        $_->import( { -into => $caller }, q{:all} )
+            for $class->provide_types_from;
+        return;
+    }
+
     my %from;
     for my $type (@types) {
         unless ($types{$type}) {
@@ -87,7 +88,7 @@ sub provide_types_from {
 sub _check_type_lib {
     my ($class, $lib) = @_;
 
-    Class::MOP::load_class($lib);
+    use_module($lib);
 
     die "Cannot use $lib in a combined type library, it does not provide any types"
         unless $lib->can('type_names');
@@ -109,10 +110,6 @@ sub _provided_types {
 
 L<MooseX::Types>
 
-=head1 AUTHOR
-
-See L<MooseX::Types/AUTHOR>.
-
 =head1 LICENSE
 
 This program is free software; you can redistribute it and/or modify